feat(announcement): お知らせの既読処理にチュートリアル受講を要求できるように (MisskeyIO#753)
This commit is contained in:
parent
c47140eab7
commit
d005daae84
30 changed files with 130 additions and 20 deletions
|
@ -36,7 +36,10 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
</MkA>
|
||||
</div>
|
||||
<div v-if="$i && !announcement.silence && !announcement.isRead" :class="$style.footer">
|
||||
<MkButton primary @click="read(announcement)"><i class="ti ti-check"></i> {{ i18n.ts.gotIt }}</MkButton>
|
||||
<MkButton primary gradate @click="read(announcement)">
|
||||
<i :class="!announcement.needEnrollmentTutorialToRead ? 'ti ti-check' : 'ti ti-presentation'"/>
|
||||
{{ !announcement.needEnrollmentTutorialToRead ? i18n.ts.gotIt : i18n.ts._initialAccountSetting.startTutorial }}
|
||||
</MkButton>
|
||||
</div>
|
||||
</section>
|
||||
</MkPagination>
|
||||
|
@ -47,7 +50,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, computed, watch } from 'vue';
|
||||
import { ref, computed, watch, defineAsyncComponent } from 'vue';
|
||||
import MkPagination from '@/components/MkPagination.vue';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
import MkInfo from '@/components/MkInfo.vue';
|
||||
|
@ -81,6 +84,17 @@ const paginationEl = ref<InstanceType<typeof MkPagination>>();
|
|||
const tab = ref('current');
|
||||
|
||||
async function read(announcement): Promise<void> {
|
||||
if (announcement.needEnrollmentTutorialToRead) {
|
||||
const tutorialCompleted = await (new Promise<boolean>(resolve => {
|
||||
os.popup(defineAsyncComponent(() => import('@/components/MkTutorialDialog.vue')), {}, {
|
||||
done: () => {
|
||||
resolve(true);
|
||||
},
|
||||
}, 'closed');
|
||||
}));
|
||||
if (!tutorialCompleted) return;
|
||||
}
|
||||
|
||||
if (announcement.needConfirmationToRead) {
|
||||
const confirm = await os.confirm({
|
||||
type: 'question',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue