forked from yojo-art/cherrypick
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat(frontend):同じノートを連続してリノートしようとしたときに警告する設定を追加 (yojo-art#409)
- Loading branch information
1 parent
676dbf7
commit 56eb85f
Showing
8 changed files
with
79 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* SPDX-FileCopyrightText: syuilo and misskey-project, yojo-art team | ||
* SPDX-License-Identifier: AGPL-3.0-only | ||
*/ | ||
import { i18n } from '@/i18n.js'; | ||
import * as os from '@/os.js'; | ||
import { defaultStore } from '@/store.js'; | ||
|
||
export async function confirmRenote(renoteId:string) : Promise<boolean> { | ||
if (defaultStore.state.checkMultipleRenote === false ) return false; | ||
const lastRenoteId = localStorage.getItem('lastRenoteId'); | ||
if (lastRenoteId) { | ||
if (lastRenoteId === renoteId) { | ||
const { canceled } = await os.confirm({ | ||
type: 'warning', | ||
title: i18n.ts._renoteConfirm.title, | ||
caption: i18n.ts._renoteConfirm.caption, | ||
okText: i18n.ts._renoteConfirm.confirm, | ||
cancelText: i18n.ts.thisPostMayBeAnnoyingCancel, | ||
}); | ||
return canceled; | ||
} | ||
} | ||
localStorage.setItem('lastRenoteId', renoteId); | ||
return false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters