fix(frontend): ログインダイアログが表示されたあとの処理がおかしくなる問題を修正 (#17038)
* fix(frontend): ログインダイアログが表示されたあとの処理がおかしくなる問題を修正 * Update Changelog
This commit is contained in:
parent
443e1ed29e
commit
a1ba403f9a
|
|
@ -13,6 +13,7 @@
|
||||||
- Enhance: ウィジェットの表示設定をプレビューを見ながら行えるように
|
- Enhance: ウィジェットの表示設定をプレビューを見ながら行えるように
|
||||||
- Enhance: ウィジェットの設定項目のラベルの多言語対応
|
- Enhance: ウィジェットの設定項目のラベルの多言語対応
|
||||||
- Fix: ドライブクリーナーでファイルを削除しても画面に反映されない問題を修正 #16061
|
- Fix: ドライブクリーナーでファイルを削除しても画面に反映されない問題を修正 #16061
|
||||||
|
- Fix: 非ログイン時にログインを求めるダイアログが表示された後にダイアログのぼかしが解除されず操作不能になることがある問題を修正
|
||||||
- Fix: ドライブのソートが「登録日(昇順)」の場合に正しく動作しない問題を修正
|
- Fix: ドライブのソートが「登録日(昇順)」の場合に正しく動作しない問題を修正
|
||||||
|
|
||||||
### Server
|
### Server
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,13 @@ function onFollowChange(user: Misskey.entities.UserDetailed) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function onClick() {
|
async function onClick() {
|
||||||
pleaseLogin({ openOnRemote: { type: 'web', path: `/@${props.user.username}@${props.user.host ?? host}` } });
|
const isLoggedIn = await pleaseLogin({
|
||||||
|
openOnRemote: {
|
||||||
|
type: 'web',
|
||||||
|
path: `/@${props.user.username}@${props.user.host ?? host}`,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
if (!isLoggedIn) return;
|
||||||
|
|
||||||
wait.value = true;
|
wait.value = true;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -468,8 +468,12 @@ if (!props.mock) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function renote() {
|
async function renote() {
|
||||||
pleaseLogin({ openOnRemote: pleaseLoginContext.value });
|
if (props.mock) return;
|
||||||
|
|
||||||
|
const isLoggedIn = await pleaseLogin({ openOnRemote: pleaseLoginContext.value });
|
||||||
|
if (!isLoggedIn) return;
|
||||||
|
|
||||||
showMovedDialog();
|
showMovedDialog();
|
||||||
|
|
||||||
const { menu } = getRenoteMenu({ note: note, renoteButton, mock: props.mock });
|
const { menu } = getRenoteMenu({ note: note, renoteButton, mock: props.mock });
|
||||||
|
|
@ -478,11 +482,12 @@ function renote() {
|
||||||
subscribeManuallyToNoteCapture();
|
subscribeManuallyToNoteCapture();
|
||||||
}
|
}
|
||||||
|
|
||||||
function reply(): void {
|
async function reply() {
|
||||||
pleaseLogin({ openOnRemote: pleaseLoginContext.value });
|
if (props.mock) return;
|
||||||
if (props.mock) {
|
|
||||||
return;
|
const isLoggedIn = await pleaseLogin({ openOnRemote: pleaseLoginContext.value });
|
||||||
}
|
if (!isLoggedIn) return;
|
||||||
|
|
||||||
os.post({
|
os.post({
|
||||||
reply: appearNote,
|
reply: appearNote,
|
||||||
channel: appearNote.channel,
|
channel: appearNote.channel,
|
||||||
|
|
@ -491,8 +496,10 @@ function reply(): void {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function react(): void {
|
async function react() {
|
||||||
pleaseLogin({ openOnRemote: pleaseLoginContext.value });
|
const isLoggedIn = await pleaseLogin({ openOnRemote: pleaseLoginContext.value });
|
||||||
|
if (!isLoggedIn) return;
|
||||||
|
|
||||||
showMovedDialog();
|
showMovedDialog();
|
||||||
if (appearNote.reactionAcceptance === 'likeOnly') {
|
if (appearNote.reactionAcceptance === 'likeOnly') {
|
||||||
sound.playMisskeySfx('reaction');
|
sound.playMisskeySfx('reaction');
|
||||||
|
|
@ -621,10 +628,12 @@ async function clip(): Promise<void> {
|
||||||
os.popupMenu(await getNoteClipMenu({ note: note, currentClip: currentClip?.value }), clipButton.value).then(focus);
|
os.popupMenu(await getNoteClipMenu({ note: note, currentClip: currentClip?.value }), clipButton.value).then(focus);
|
||||||
}
|
}
|
||||||
|
|
||||||
function showRenoteMenu(): void {
|
async function showRenoteMenu() {
|
||||||
if (props.mock) {
|
if (props.mock) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
const isLoggedIn = await pleaseLogin({ openOnRemote: pleaseLoginContext.value });
|
||||||
|
if (!isLoggedIn) return;
|
||||||
|
|
||||||
function getUnrenote(): MenuItem {
|
function getUnrenote(): MenuItem {
|
||||||
return {
|
return {
|
||||||
|
|
@ -649,7 +658,6 @@ function showRenoteMenu(): void {
|
||||||
};
|
};
|
||||||
|
|
||||||
if (isMyRenote) {
|
if (isMyRenote) {
|
||||||
pleaseLogin({ openOnRemote: pleaseLoginContext.value });
|
|
||||||
os.popupMenu([
|
os.popupMenu([
|
||||||
renoteDetailsMenu,
|
renoteDetailsMenu,
|
||||||
getCopyNoteLinkMenu(note, i18n.ts.copyLinkRenote),
|
getCopyNoteLinkMenu(note, i18n.ts.copyLinkRenote),
|
||||||
|
|
|
||||||
|
|
@ -448,8 +448,10 @@ if (appearNote.reactionAcceptance === 'likeOnly') {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function renote() {
|
async function renote() {
|
||||||
pleaseLogin({ openOnRemote: pleaseLoginContext.value });
|
const isLoggedIn = await pleaseLogin({ openOnRemote: pleaseLoginContext.value });
|
||||||
|
if (!isLoggedIn) return;
|
||||||
|
|
||||||
showMovedDialog();
|
showMovedDialog();
|
||||||
|
|
||||||
const { menu } = getRenoteMenu({ note: note, renoteButton });
|
const { menu } = getRenoteMenu({ note: note, renoteButton });
|
||||||
|
|
@ -459,8 +461,10 @@ function renote() {
|
||||||
subscribeManuallyToNoteCapture();
|
subscribeManuallyToNoteCapture();
|
||||||
}
|
}
|
||||||
|
|
||||||
function reply(): void {
|
async function reply() {
|
||||||
pleaseLogin({ openOnRemote: pleaseLoginContext.value });
|
const isLoggedIn = await pleaseLogin({ openOnRemote: pleaseLoginContext.value });
|
||||||
|
if (!isLoggedIn) return;
|
||||||
|
|
||||||
showMovedDialog();
|
showMovedDialog();
|
||||||
os.post({
|
os.post({
|
||||||
reply: appearNote,
|
reply: appearNote,
|
||||||
|
|
@ -470,8 +474,10 @@ function reply(): void {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function react(): void {
|
async function react() {
|
||||||
pleaseLogin({ openOnRemote: pleaseLoginContext.value });
|
const isLoggedIn = await pleaseLogin({ openOnRemote: pleaseLoginContext.value });
|
||||||
|
if (!isLoggedIn) return;
|
||||||
|
|
||||||
showMovedDialog();
|
showMovedDialog();
|
||||||
if (appearNote.reactionAcceptance === 'likeOnly') {
|
if (appearNote.reactionAcceptance === 'likeOnly') {
|
||||||
sound.playMisskeySfx('reaction');
|
sound.playMisskeySfx('reaction');
|
||||||
|
|
@ -569,9 +575,12 @@ async function clip(): Promise<void> {
|
||||||
os.popupMenu(await getNoteClipMenu({ note: note }), clipButton.value).then(focus);
|
os.popupMenu(await getNoteClipMenu({ note: note }), clipButton.value).then(focus);
|
||||||
}
|
}
|
||||||
|
|
||||||
function showRenoteMenu(): void {
|
async function showRenoteMenu() {
|
||||||
if (!isMyRenote) return;
|
if (!isMyRenote) return;
|
||||||
pleaseLogin({ openOnRemote: pleaseLoginContext.value });
|
|
||||||
|
const isLoggedIn = await pleaseLogin({ openOnRemote: pleaseLoginContext.value });
|
||||||
|
if (!isLoggedIn) return;
|
||||||
|
|
||||||
os.popupMenu([{
|
os.popupMenu([{
|
||||||
text: i18n.ts.unrenote,
|
text: i18n.ts.unrenote,
|
||||||
icon: 'ti ti-trash',
|
icon: 'ti ti-trash',
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,8 @@ const pleaseLoginContext = computed<OpenOnRemoteOptions>(() => ({
|
||||||
const vote = async (id: number) => {
|
const vote = async (id: number) => {
|
||||||
if (props.readOnly || closed.value || isVoted.value) return;
|
if (props.readOnly || closed.value || isVoted.value) return;
|
||||||
|
|
||||||
pleaseLogin({ openOnRemote: pleaseLoginContext.value });
|
const isLoggedIn = await pleaseLogin({ openOnRemote: pleaseLoginContext.value });
|
||||||
|
if (!isLoggedIn) return;
|
||||||
|
|
||||||
const { canceled } = await os.confirm({
|
const { canceled } = await os.confirm({
|
||||||
type: 'question',
|
type: 'question',
|
||||||
|
|
|
||||||
|
|
@ -709,8 +709,8 @@ export function contextMenu(items: MenuItem[], ev: MouseEvent): Promise<void> {
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
export function post(props: PostFormProps = {}): Promise<void> {
|
export async function post(props: PostFormProps = {}): Promise<void> {
|
||||||
pleaseLogin({
|
const isLoggedIn = await pleaseLogin({
|
||||||
openOnRemote: (props.initialText || props.initialNote ? {
|
openOnRemote: (props.initialText || props.initialNote ? {
|
||||||
type: 'share',
|
type: 'share',
|
||||||
params: {
|
params: {
|
||||||
|
|
@ -720,6 +720,7 @@ export function post(props: PostFormProps = {}): Promise<void> {
|
||||||
},
|
},
|
||||||
} : undefined),
|
} : undefined),
|
||||||
});
|
});
|
||||||
|
if (!isLoggedIn) return;
|
||||||
|
|
||||||
showMovedDialog();
|
showMovedDialog();
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
|
|
|
||||||
|
|
@ -151,9 +151,11 @@ function shareWithNote() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function like() {
|
async function like() {
|
||||||
if (!flash.value) return;
|
if (!flash.value) return;
|
||||||
pleaseLogin();
|
|
||||||
|
const isLoggedIn = await pleaseLogin();
|
||||||
|
if (!isLoggedIn) return;
|
||||||
|
|
||||||
os.apiWithDialog('flash/like', {
|
os.apiWithDialog('flash/like', {
|
||||||
flashId: flash.value.id,
|
flashId: flash.value.id,
|
||||||
|
|
@ -165,7 +167,9 @@ function like() {
|
||||||
|
|
||||||
async function unlike() {
|
async function unlike() {
|
||||||
if (!flash.value) return;
|
if (!flash.value) return;
|
||||||
pleaseLogin();
|
|
||||||
|
const isLoggedIn = await pleaseLogin();
|
||||||
|
if (!isLoggedIn) return;
|
||||||
|
|
||||||
const confirm = await os.confirm({
|
const confirm = await os.confirm({
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
|
|
|
||||||
|
|
@ -197,7 +197,8 @@ async function matchHeatbeat() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function matchUser() {
|
async function matchUser() {
|
||||||
pleaseLogin();
|
const isLoggedIn = await pleaseLogin();
|
||||||
|
if (!isLoggedIn) return;
|
||||||
|
|
||||||
const user = await os.selectUser({ includeSelf: false, localOnly: true });
|
const user = await os.selectUser({ includeSelf: false, localOnly: true });
|
||||||
if (user == null) return;
|
if (user == null) return;
|
||||||
|
|
@ -207,8 +208,9 @@ async function matchUser() {
|
||||||
matchHeatbeat();
|
matchHeatbeat();
|
||||||
}
|
}
|
||||||
|
|
||||||
function matchAny(ev: MouseEvent) {
|
async function matchAny(ev: MouseEvent) {
|
||||||
pleaseLogin();
|
const isLoggedIn = await pleaseLogin();
|
||||||
|
if (!isLoggedIn) return;
|
||||||
|
|
||||||
os.popupMenu([{
|
os.popupMenu([{
|
||||||
text: i18n.ts._reversi.allowIrregularRules,
|
text: i18n.ts._reversi.allowIrregularRules,
|
||||||
|
|
|
||||||
|
|
@ -48,8 +48,8 @@ export async function pleaseLogin(opts: {
|
||||||
path?: string;
|
path?: string;
|
||||||
message?: string;
|
message?: string;
|
||||||
openOnRemote?: OpenOnRemoteOptions;
|
openOnRemote?: OpenOnRemoteOptions;
|
||||||
} = {}) {
|
} = {}): Promise<boolean> {
|
||||||
if ($i) return;
|
if ($i != null) return true;
|
||||||
|
|
||||||
let _openOnRemote: OpenOnRemoteOptions | undefined = undefined;
|
let _openOnRemote: OpenOnRemoteOptions | undefined = undefined;
|
||||||
|
|
||||||
|
|
@ -71,5 +71,5 @@ export async function pleaseLogin(opts: {
|
||||||
closed: () => dispose(),
|
closed: () => dispose(),
|
||||||
});
|
});
|
||||||
|
|
||||||
throw new Error('signin required');
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue