enhance(frontend): クリップボタンをノートアクションに追加できるように

This commit is contained in:
syuilo
2023-03-24 16:54:37 +09:00
parent e438091113
commit 5f52b13325
13 changed files with 199 additions and 62 deletions

View File

@@ -30,6 +30,7 @@ import * as os from '@/os';
import { definePageMetadata } from '@/scripts/page-metadata';
import { url } from '@/config';
import MkButton from '@/components/MkButton.vue';
import { clipsCache } from '@/cache';
const props = defineProps<{
clipId: string,
@@ -108,6 +109,8 @@ const headerActions = $computed(() => clip && isOwned ? [{
clipId: clip.id,
...result,
});
clipsCache.delete();
},
}, ...(clip.isPublic ? [{
icon: 'ti ti-share',
@@ -133,6 +136,8 @@ const headerActions = $computed(() => clip && isOwned ? [{
await os.apiWithDialog('clips/delete', {
clipId: clip.id,
});
clipsCache.delete();
},
}] : null);