refactor
This commit is contained in:
		| @@ -154,8 +154,6 @@ export default defineComponent({ | |||||||
| 	}, | 	}, | ||||||
|  |  | ||||||
| 	mounted() { | 	mounted() { | ||||||
| 		this.$emit('info', this[symbols.PAGE_INFO]); |  | ||||||
|  |  | ||||||
| 		os.api('users/stats', { | 		os.api('users/stats', { | ||||||
| 			userId: this.$i.id | 			userId: this.$i.id | ||||||
| 		}).then(stats => { | 		}).then(stats => { | ||||||
|   | |||||||
| @@ -53,10 +53,6 @@ export default defineComponent({ | |||||||
| 		}; | 		}; | ||||||
| 	}, | 	}, | ||||||
|  |  | ||||||
| 	mounted() { |  | ||||||
| 		this.$emit('info', this[symbols.PAGE_INFO]); |  | ||||||
| 	}, |  | ||||||
|  |  | ||||||
| 	methods: { | 	methods: { | ||||||
| 		menu(account, ev) { | 		menu(account, ev) { | ||||||
| 			os.popupMenu([{ | 			os.popupMenu([{ | ||||||
|   | |||||||
| @@ -32,10 +32,6 @@ export default defineComponent({ | |||||||
| 		}; | 		}; | ||||||
| 	}, | 	}, | ||||||
|  |  | ||||||
| 	mounted() { |  | ||||||
| 		this.$emit('info', this[symbols.PAGE_INFO]); |  | ||||||
| 	}, |  | ||||||
|  |  | ||||||
| 	methods: { | 	methods: { | ||||||
| 		generateToken() { | 		generateToken() { | ||||||
| 			os.popup(import('@/components/token-generate-window.vue'), {}, { | 			os.popup(import('@/components/token-generate-window.vue'), {}, { | ||||||
|   | |||||||
| @@ -67,10 +67,6 @@ export default defineComponent({ | |||||||
| 		}; | 		}; | ||||||
| 	}, | 	}, | ||||||
|  |  | ||||||
| 	mounted() { |  | ||||||
| 		this.$emit('info', this[symbols.PAGE_INFO]); |  | ||||||
| 	}, |  | ||||||
|  |  | ||||||
| 	methods: { | 	methods: { | ||||||
| 		revoke(token) { | 		revoke(token) { | ||||||
| 			os.api('i/revoke-token', { tokenId: token.id }).then(() => { | 			os.api('i/revoke-token', { tokenId: token.id }).then(() => { | ||||||
|   | |||||||
| @@ -37,8 +37,6 @@ export default defineComponent({ | |||||||
| 	}, | 	}, | ||||||
|  |  | ||||||
| 	mounted() { | 	mounted() { | ||||||
| 		this.$emit('info', this[symbols.PAGE_INFO]); |  | ||||||
|  |  | ||||||
| 		this.$watch('localCustomCss', this.apply); | 		this.$watch('localCustomCss', this.apply); | ||||||
| 	}, | 	}, | ||||||
|  |  | ||||||
|   | |||||||
| @@ -83,10 +83,6 @@ export default defineComponent({ | |||||||
| 		} | 		} | ||||||
| 	}, | 	}, | ||||||
|  |  | ||||||
| 	mounted() { |  | ||||||
| 		this.$emit('info', this[symbols.PAGE_INFO]); |  | ||||||
| 	}, |  | ||||||
|  |  | ||||||
| 	methods: { | 	methods: { | ||||||
| 		async setProfile() { | 		async setProfile() { | ||||||
| 			const { canceled, result: name } = await os.inputText({ | 			const { canceled, result: name } = await os.inputText({ | ||||||
|   | |||||||
| @@ -33,10 +33,6 @@ export default defineComponent({ | |||||||
| 		} | 		} | ||||||
| 	}, | 	}, | ||||||
|  |  | ||||||
| 	mounted() { |  | ||||||
| 		this.$emit('info', this[symbols.PAGE_INFO]); |  | ||||||
| 	}, |  | ||||||
|  |  | ||||||
| 	methods: { | 	methods: { | ||||||
| 		async deleteAccount() { | 		async deleteAccount() { | ||||||
| 			{ | 			{ | ||||||
|   | |||||||
| @@ -99,10 +99,6 @@ export default defineComponent({ | |||||||
| 		} | 		} | ||||||
| 	}, | 	}, | ||||||
|  |  | ||||||
| 	mounted() { |  | ||||||
| 		this.$emit('info', this[symbols.PAGE_INFO]); |  | ||||||
| 	}, |  | ||||||
|  |  | ||||||
| 	methods: { | 	methods: { | ||||||
| 		chooseUploadFolder() { | 		chooseUploadFolder() { | ||||||
| 			os.selectDriveFolder(false).then(async folder => { | 			os.selectDriveFolder(false).then(async folder => { | ||||||
|   | |||||||
| @@ -111,8 +111,6 @@ export default defineComponent({ | |||||||
| 		}); | 		}); | ||||||
|  |  | ||||||
| 		onMounted(() => { | 		onMounted(() => { | ||||||
| 			context.emit('info', INFO); |  | ||||||
|  |  | ||||||
| 			watch(emailAddress, () => { | 			watch(emailAddress, () => { | ||||||
| 				saveEmailAddress(); | 				saveEmailAddress(); | ||||||
| 			}); | 			}); | ||||||
|   | |||||||
| @@ -195,10 +195,6 @@ export default defineComponent({ | |||||||
| 		}, | 		}, | ||||||
| 	}, | 	}, | ||||||
|  |  | ||||||
| 	mounted() { |  | ||||||
| 		this.$emit('info', this[symbols.PAGE_INFO]); |  | ||||||
| 	}, |  | ||||||
|  |  | ||||||
| 	methods: { | 	methods: { | ||||||
| 		async reloadAsk() { | 		async reloadAsk() { | ||||||
| 			const { canceled } = await os.confirm({ | 			const { canceled } = await os.confirm({ | ||||||
|   | |||||||
| @@ -133,10 +133,6 @@ export default defineComponent({ | |||||||
| 			os.api('i/import-blocking', { fileId: file.id }).then(onImportSuccess).catch(onError); | 			os.api('i/import-blocking', { fileId: file.id }).then(onImportSuccess).catch(onError); | ||||||
| 		}; | 		}; | ||||||
|  |  | ||||||
| 		onMounted(() => { |  | ||||||
| 			context.emit('info', INFO); |  | ||||||
| 		}); |  | ||||||
|  |  | ||||||
| 		return { | 		return { | ||||||
| 			[symbols.PAGE_INFO]: INFO, | 			[symbols.PAGE_INFO]: INFO, | ||||||
| 			excludeMutingUsers, | 			excludeMutingUsers, | ||||||
|   | |||||||
| @@ -14,7 +14,7 @@ | |||||||
| 			</div> | 			</div> | ||||||
| 			<div class="main"> | 			<div class="main"> | ||||||
| 				<div class="bkzroven"> | 				<div class="bkzroven"> | ||||||
| 					<component :is="component" :key="page" v-bind="pageProps" @info="onInfo"/> | 					<component :is="component" :ref="el => pageChanged(el)" :key="page" v-bind="pageProps"/> | ||||||
| 				</div> | 				</div> | ||||||
| 			</div> | 			</div> | ||||||
| 		</div> | 		</div> | ||||||
| @@ -250,8 +250,9 @@ export default defineComponent({ | |||||||
|  |  | ||||||
| 		const emailNotConfigured = computed(() => instance.enableEmail && ($i.email == null || !$i.emailVerified)); | 		const emailNotConfigured = computed(() => instance.enableEmail && ($i.email == null || !$i.emailVerified)); | ||||||
|  |  | ||||||
| 		const onInfo = (info) => { | 		const pageChanged = (page) => { | ||||||
| 			childInfo.value = info; | 			if (page == null) return; | ||||||
|  | 			childInfo.value = page[symbols.PAGE_INFO]; | ||||||
| 		}; | 		}; | ||||||
|  |  | ||||||
| 		return { | 		return { | ||||||
| @@ -264,7 +265,7 @@ export default defineComponent({ | |||||||
| 			pageProps, | 			pageProps, | ||||||
| 			component, | 			component, | ||||||
| 			emailNotConfigured, | 			emailNotConfigured, | ||||||
| 			onInfo, | 			pageChanged, | ||||||
| 			childInfo, | 			childInfo, | ||||||
| 		}; | 		}; | ||||||
| 	}, | 	}, | ||||||
|   | |||||||
| @@ -47,11 +47,6 @@ export default defineComponent({ | |||||||
| 		}, | 		}, | ||||||
| 	}, | 	}, | ||||||
|  |  | ||||||
| 	mounted() { |  | ||||||
| 		this.$emit('info', this[symbols.PAGE_INFO]); |  | ||||||
| 	}, |  | ||||||
|  |  | ||||||
|  |  | ||||||
| 	async created() { | 	async created() { | ||||||
| 		this.instanceMutes = this.$i.mutedInstances.join('\n'); | 		this.instanceMutes = this.$i.mutedInstances.join('\n'); | ||||||
| 	}, | 	}, | ||||||
|   | |||||||
| @@ -73,8 +73,6 @@ export default defineComponent({ | |||||||
| 	}, | 	}, | ||||||
|  |  | ||||||
| 	mounted() { | 	mounted() { | ||||||
| 		this.$emit('info', this[symbols.PAGE_INFO]); |  | ||||||
|  |  | ||||||
| 		document.cookie = `igi=${this.$i.token}; path=/;` + | 		document.cookie = `igi=${this.$i.token}; path=/;` + | ||||||
| 			` max-age=31536000;` + | 			` max-age=31536000;` + | ||||||
| 			(document.location.protocol.startsWith('https') ? ' secure' : ''); | 			(document.location.protocol.startsWith('https') ? ' secure' : ''); | ||||||
|   | |||||||
| @@ -67,10 +67,6 @@ export default defineComponent({ | |||||||
| 		}, | 		}, | ||||||
| 	}, | 	}, | ||||||
|  |  | ||||||
| 	mounted() { |  | ||||||
| 		this.$emit('info', this[symbols.PAGE_INFO]); |  | ||||||
| 	}, |  | ||||||
|  |  | ||||||
| 	methods: { | 	methods: { | ||||||
| 		async addItem() { | 		async addItem() { | ||||||
| 			const menu = Object.keys(this.menuDef).filter(k => !this.$store.state.menu.includes(k)); | 			const menu = Object.keys(this.menuDef).filter(k => !this.$store.state.menu.includes(k)); | ||||||
|   | |||||||
| @@ -66,10 +66,6 @@ export default defineComponent({ | |||||||
| 		} | 		} | ||||||
| 	}, | 	}, | ||||||
|  |  | ||||||
| 	mounted() { |  | ||||||
| 		this.$emit('info', this[symbols.PAGE_INFO]); |  | ||||||
| 	}, |  | ||||||
|  |  | ||||||
| 	methods: { | 	methods: { | ||||||
| 		userPage | 		userPage | ||||||
| 	} | 	} | ||||||
|   | |||||||
| @@ -37,10 +37,6 @@ export default defineComponent({ | |||||||
| 		} | 		} | ||||||
| 	}, | 	}, | ||||||
|  |  | ||||||
| 	mounted() { |  | ||||||
| 		this.$emit('info', this[symbols.PAGE_INFO]); |  | ||||||
| 	}, |  | ||||||
|  |  | ||||||
| 	methods: { | 	methods: { | ||||||
| 		readAllUnreadNotes() { | 		readAllUnreadNotes() { | ||||||
| 			os.api('i/read-all-unread-notes'); | 			os.api('i/read-all-unread-notes'); | ||||||
|   | |||||||
| @@ -47,10 +47,6 @@ export default defineComponent({ | |||||||
| 		reportError: defaultStore.makeGetterSetter('reportError'), | 		reportError: defaultStore.makeGetterSetter('reportError'), | ||||||
| 	}, | 	}, | ||||||
|  |  | ||||||
| 	mounted() { |  | ||||||
| 		this.$emit('info', this[symbols.PAGE_INFO]); |  | ||||||
| 	}, |  | ||||||
|  |  | ||||||
| 	methods: { | 	methods: { | ||||||
| 		changeDebug(v) { | 		changeDebug(v) { | ||||||
| 			console.log(v); | 			console.log(v); | ||||||
|   | |||||||
| @@ -45,10 +45,6 @@ export default defineComponent({ | |||||||
| 		} | 		} | ||||||
| 	}, | 	}, | ||||||
|  |  | ||||||
| 	mounted() { |  | ||||||
| 		this.$emit('info', this[symbols.PAGE_INFO]); |  | ||||||
| 	}, |  | ||||||
|  |  | ||||||
| 	methods: { | 	methods: { | ||||||
| 		installPlugin({ id, meta, ast, token }) { | 		installPlugin({ id, meta, ast, token }) { | ||||||
| 			ColdDeviceStorage.set('plugins', ColdDeviceStorage.get('plugins').concat({ | 			ColdDeviceStorage.set('plugins', ColdDeviceStorage.get('plugins').concat({ | ||||||
|   | |||||||
| @@ -64,10 +64,6 @@ export default defineComponent({ | |||||||
| 		} | 		} | ||||||
| 	}, | 	}, | ||||||
|  |  | ||||||
| 	mounted() { |  | ||||||
| 		this.$emit('info', this[symbols.PAGE_INFO]); |  | ||||||
| 	}, |  | ||||||
|  |  | ||||||
| 	methods: { | 	methods: { | ||||||
| 		uninstall(plugin) { | 		uninstall(plugin) { | ||||||
| 			ColdDeviceStorage.set('plugins', this.plugins.filter(x => x.id !== plugin.id)); | 			ColdDeviceStorage.set('plugins', this.plugins.filter(x => x.id !== plugin.id)); | ||||||
|   | |||||||
| @@ -101,10 +101,6 @@ export default defineComponent({ | |||||||
| 		this.ffVisibility = this.$i.ffVisibility; | 		this.ffVisibility = this.$i.ffVisibility; | ||||||
| 	}, | 	}, | ||||||
|  |  | ||||||
| 	mounted() { |  | ||||||
| 		this.$emit('info', this[symbols.PAGE_INFO]); |  | ||||||
| 	}, |  | ||||||
|  |  | ||||||
| 	methods: { | 	methods: { | ||||||
| 		save() { | 		save() { | ||||||
| 			os.api('i/update', { | 			os.api('i/update', { | ||||||
|   | |||||||
| @@ -132,10 +132,6 @@ export default defineComponent({ | |||||||
| 		this.$watch('alwaysMarkNsfw', this.save); | 		this.$watch('alwaysMarkNsfw', this.save); | ||||||
| 	}, | 	}, | ||||||
|  |  | ||||||
| 	mounted() { |  | ||||||
| 		this.$emit('info', this[symbols.PAGE_INFO]); |  | ||||||
| 	}, |  | ||||||
|  |  | ||||||
| 	methods: { | 	methods: { | ||||||
| 		changeAvatar(e) { | 		changeAvatar(e) { | ||||||
| 			selectFile(e.currentTarget || e.target, this.$ts.avatar).then(file => { | 			selectFile(e.currentTarget || e.target, this.$ts.avatar).then(file => { | ||||||
|   | |||||||
| @@ -100,10 +100,6 @@ export default defineComponent({ | |||||||
| 		} | 		} | ||||||
| 	}, | 	}, | ||||||
|  |  | ||||||
| 	mounted() { |  | ||||||
| 		this.$emit('info', this[symbols.PAGE_INFO]); |  | ||||||
| 	}, |  | ||||||
|  |  | ||||||
| 	methods: { | 	methods: { | ||||||
| 		save() { | 		save() { | ||||||
| 			this.$store.set('reactions', this.reactions); | 			this.$store.set('reactions', this.reactions); | ||||||
|   | |||||||
| @@ -72,10 +72,6 @@ export default defineComponent({ | |||||||
| 		} | 		} | ||||||
| 	}, | 	}, | ||||||
|  |  | ||||||
| 	mounted() { |  | ||||||
| 		this.$emit('info', this[symbols.PAGE_INFO]); |  | ||||||
| 	}, |  | ||||||
|  |  | ||||||
| 	methods: { | 	methods: { | ||||||
| 		async change() { | 		async change() { | ||||||
| 			const { canceled: canceled1, result: currentPassword } = await os.inputText({ | 			const { canceled: canceled1, result: currentPassword } = await os.inputText({ | ||||||
|   | |||||||
| @@ -96,10 +96,6 @@ export default defineComponent({ | |||||||
| 		this.sounds.channel = ColdDeviceStorage.get('sound_channel'); | 		this.sounds.channel = ColdDeviceStorage.get('sound_channel'); | ||||||
| 	}, | 	}, | ||||||
|  |  | ||||||
| 	mounted() { |  | ||||||
| 		this.$emit('info', this[symbols.PAGE_INFO]); |  | ||||||
| 	}, |  | ||||||
|  |  | ||||||
| 	methods: { | 	methods: { | ||||||
| 		async edit(type) { | 		async edit(type) { | ||||||
| 			const { canceled, result } = await os.form(this.$t('_sfx.' + type), { | 			const { canceled, result } = await os.form(this.$t('_sfx.' + type), { | ||||||
|   | |||||||
| @@ -40,10 +40,6 @@ export default defineComponent({ | |||||||
| 		} | 		} | ||||||
| 	}, | 	}, | ||||||
|  |  | ||||||
| 	mounted() { |  | ||||||
| 		this.$emit('info', this[symbols.PAGE_INFO]); |  | ||||||
| 	}, |  | ||||||
|  |  | ||||||
| 	methods: { | 	methods: { | ||||||
| 		parseThemeCode(code) { | 		parseThemeCode(code) { | ||||||
| 			let theme; | 			let theme; | ||||||
|   | |||||||
| @@ -78,10 +78,6 @@ export default defineComponent({ | |||||||
| 		}, | 		}, | ||||||
| 	}, | 	}, | ||||||
|  |  | ||||||
| 	mounted() { |  | ||||||
| 		this.$emit('info', this[symbols.PAGE_INFO]); |  | ||||||
| 	}, |  | ||||||
|  |  | ||||||
| 	methods: { | 	methods: { | ||||||
| 		copyThemeCode() { | 		copyThemeCode() { | ||||||
| 			copyToClipboard(this.selectedThemeCode); | 			copyToClipboard(this.selectedThemeCode); | ||||||
|   | |||||||
| @@ -163,10 +163,6 @@ export default defineComponent({ | |||||||
| 			location.reload(); | 			location.reload(); | ||||||
| 		}); | 		}); | ||||||
|  |  | ||||||
| 		onMounted(() => { |  | ||||||
| 			emit('info', INFO); |  | ||||||
| 		}); |  | ||||||
|  |  | ||||||
| 		onActivated(() => { | 		onActivated(() => { | ||||||
| 			fetchThemes().then(() => { | 			fetchThemes().then(() => { | ||||||
| 				installedThemes.value = getThemes(); | 				installedThemes.value = getThemes(); | ||||||
|   | |||||||
| @@ -87,10 +87,6 @@ export default defineComponent({ | |||||||
| 		this.hardWordMutedNotesCount = (await os.api('i/get-word-muted-notes-count', {})).count; | 		this.hardWordMutedNotesCount = (await os.api('i/get-word-muted-notes-count', {})).count; | ||||||
| 	}, | 	}, | ||||||
|  |  | ||||||
| 	mounted() { |  | ||||||
| 		this.$emit('info', this[symbols.PAGE_INFO]); |  | ||||||
| 	}, |  | ||||||
|  |  | ||||||
| 	methods: { | 	methods: { | ||||||
| 		async save() { | 		async save() { | ||||||
| 			this.$store.set('mutedWords', this.softMutedWords.trim().split('\n').map(x => x.trim().split(' '))); | 			this.$store.set('mutedWords', this.softMutedWords.trim().split('\n').map(x => x.trim().split(' '))); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 syuilo
					syuilo