feat: also copy aime.txt

This commit is contained in:
2025-04-10 13:53:20 +00:00
parent 9ea66dbeab
commit d63d81e349
4 changed files with 29 additions and 6 deletions

View File

@ -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>

View File

@ -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');
},
});
}