Skip to content

Commit

Permalink
improve: add auth check
Browse files Browse the repository at this point in the history
  • Loading branch information
xpadev-net committed Nov 22, 2023
1 parent 9601aab commit a81cb60
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/@types/niconico.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,19 @@ export type TWatchV3Metadata<T extends "dmc" | "dms" | "" = ""> = {
commentableUserTypeForPayment: string;
"9d091f87": boolean;
};
viewer: V3MetadataViewerItem | null;
};
};

export type V3MetadataViewerItem = {
id: number;
nickname: string;
isPremium: boolean;
allowSensitiveContents: boolean;
existence: {
age: number;
prefecture: string;
sex: string;
};
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ const RemoteCommentPicker: FC<Props> = ({ onChange }) => {
});
return;
}
if (targetMetadata.data.viewer === null) {
setMessage({
title: "ログインが必須です",
content: "コメントのダウンロードにはアカウントが必須です",
});
return;
}
setMetadata(targetMetadata);
lastUrl.current = nicoId;
})();
Expand Down

0 comments on commit a81cb60

Please sign in to comment.