mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-22 20:23:49 +01:00
refactor(client): refactor import-export to use Composition API (#8579)
This commit is contained in:
parent
e0950fe5ea
commit
edf8f94fec
@ -37,8 +37,8 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, onMounted, ref } from 'vue';
|
||||
<script lang="ts" setup>
|
||||
import { defineExpose, ref } from 'vue';
|
||||
import MkButton from '@/components/ui/button.vue';
|
||||
import FormSection from '@/components/form/section.vue';
|
||||
import FormGroup from '@/components/form/group.vue';
|
||||
@ -48,23 +48,6 @@ import { selectFile } from '@/scripts/select-file';
|
||||
import * as symbols from '@/symbols';
|
||||
import { i18n } from '@/i18n';
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
FormSection,
|
||||
FormGroup,
|
||||
FormSwitch,
|
||||
MkButton,
|
||||
},
|
||||
|
||||
emits: ['info'],
|
||||
|
||||
setup(props, context) {
|
||||
const INFO = {
|
||||
title: i18n.ts.importAndExport,
|
||||
icon: 'fas fa-boxes',
|
||||
bg: 'var(--bg)',
|
||||
};
|
||||
|
||||
const excludeMutingUsers = ref(false);
|
||||
const excludeInactiveUsers = ref(false);
|
||||
|
||||
@ -82,10 +65,10 @@ export default defineComponent({
|
||||
});
|
||||
};
|
||||
|
||||
const onError = (e) => {
|
||||
const onError = (ev) => {
|
||||
os.alert({
|
||||
type: 'error',
|
||||
text: e.message,
|
||||
text: ev.message,
|
||||
});
|
||||
};
|
||||
|
||||
@ -133,23 +116,12 @@ export default defineComponent({
|
||||
os.api('i/import-blocking', { fileId: file.id }).then(onImportSuccess).catch(onError);
|
||||
};
|
||||
|
||||
return {
|
||||
[symbols.PAGE_INFO]: INFO,
|
||||
excludeMutingUsers,
|
||||
excludeInactiveUsers,
|
||||
|
||||
exportNotes,
|
||||
exportFollowing,
|
||||
exportBlocking,
|
||||
exportUserLists,
|
||||
exportMuting,
|
||||
|
||||
importFollowing,
|
||||
importUserLists,
|
||||
importMuting,
|
||||
importBlocking,
|
||||
};
|
||||
},
|
||||
defineExpose({
|
||||
[symbols.PAGE_INFO]: {
|
||||
title: i18n.ts.importAndExport,
|
||||
icon: 'fas fa-boxes',
|
||||
bg: 'var(--bg)',
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user