summaryrefslogtreecommitdiff
path: root/src/client/app/desktop/api/post.ts
blob: 3ff9c5bb8c3727d30c61fe06d6178d9ea3f0df86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import OS from '../../mios';
import PostFormWindow from '../views/components/post-form-window.vue';
import RenoteFormWindow from '../views/components/renote-form-window.vue';

export default (os: OS) => opts => {
	const o = opts || {};
	if (o.renote) {
		const vm = os.new(RenoteFormWindow, {
			note: o.renote,
			animation: o.animation == null ? true : o.animation
		});
		if (o.cb) vm.$once('closed', o.cb);
		document.body.appendChild(vm.$el);
	} else {
		const vm = os.new(PostFormWindow, {
			reply: o.reply,
			animation: o.animation == null ? true : o.animation
		});
		if (o.cb) vm.$once('closed', o.cb);
		document.body.appendChild(vm.$el);
	}
};