forked from akanyan/STARTLINER
feat: also copy aime.txt
This commit is contained in:
@ -3,6 +3,7 @@ import { computed, ref } from 'vue';
|
||||
import InputText from 'primevue/inputtext';
|
||||
import Select from 'primevue/select';
|
||||
import ToggleSwitch from 'primevue/toggleswitch';
|
||||
import { listen } from '@tauri-apps/api/event';
|
||||
import * as path from '@tauri-apps/api/path';
|
||||
import { readTextFile, writeTextFile } from '@tauri-apps/plugin-fs';
|
||||
import OptionCategory from '../OptionCategory.vue';
|
||||
@ -40,10 +41,14 @@ const aimeCodePaste = (ev: ClipboardEvent) => {
|
||||
.join('') ?? '';
|
||||
};
|
||||
|
||||
(async () => {
|
||||
const load = async () => {
|
||||
const aime_path = await path.join(await prf.configDir, 'aime.txt');
|
||||
aimeCode.value = await readTextFile(aime_path).catch(() => '');
|
||||
})();
|
||||
};
|
||||
|
||||
listen('reload-aime-code', load);
|
||||
|
||||
load();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -2,6 +2,7 @@
|
||||
import { computed } from 'vue';
|
||||
import Select from 'primevue/select';
|
||||
import { useConfirm } from 'primevue/useconfirm';
|
||||
import { emit } from '@tauri-apps/api/event';
|
||||
import * as path from '@tauri-apps/api/path';
|
||||
import FilePicker from '../FilePicker.vue';
|
||||
import OptionCategory from '../OptionCategory.vue';
|
||||
@ -45,6 +46,7 @@ const checkSegatoolsIni = async (target: string) => {
|
||||
accept: async () => {
|
||||
await invoke('load_segatools_ini', { path: iniPath });
|
||||
await prf.reload();
|
||||
await emit('reload-aime-code');
|
||||
},
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user