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>