🐛 Fix: i18n bug

This commit is contained in:
PiEgg
2023-01-07 20:45:01 +08:00
parent 66d8d714db
commit 911e34e98d
9 changed files with 36 additions and 17 deletions

View File

@@ -549,7 +549,6 @@ async function handlePasteStyleChange (val: string) {
}
onBeforeUnmount(() => {
console.log('unmounted')
ipcRenderer.removeAllListeners('updateGallery')
ipcRenderer.removeListener(GET_PICBEDS, getPicBeds)
})

View File

@@ -112,26 +112,22 @@ onBeforeRouteUpdate((to, from, next) => {
if (to.params.type && (to.name === UPLOADER_CONFIG_PAGE)) {
type.value = to.params.type as string
getCurrentConfigList()
console.log(type.value)
}
next()
})
onBeforeMount(() => {
type.value = $route.params.type as string
console.log(type.value)
getCurrentConfigList()
})
async function getCurrentConfigList () {
const configList = await triggerRPC<IUploaderConfigItem>(IRPCActionType.GET_PICBED_CONFIG_LIST, type.value)
console.log(configList)
curConfigList.value = configList?.configList ?? []
defaultConfigId.value = configList?.defaultId ?? ''
}
function openEditPage (configId: string) {
console.log(configId, type.value, defaultConfigId.value)
$router.push({
name: PICBEDS_PAGE,
params: {

View File

@@ -60,7 +60,6 @@ const $route = useRoute()
const $router = useRouter()
const $configForm = ref<InstanceType<typeof ConfigForm> | null>(null)
type.value = $route.params.type as string
console.log('picbed type', $route.params.type)
onBeforeMount(() => {
sendToMain('getPicBedConfig', $route.params.type)
@@ -69,7 +68,6 @@ onBeforeMount(() => {
const handleConfirm = async () => {
const result = (await $configForm.value?.validate()) || false
console.log(result)
if (result !== false) {
await triggerRPC<void>(IRPCActionType.UPDATE_UPLOADER_CONFIG, type.value, result?._id, result)
const successNotification = new Notification($T('SETTINGS_RESULT'), {