mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-07 17:35:28 +00:00
feat(modal): port Error and ShowToken
This commit is contained in:
@@ -25,6 +25,7 @@ import { useTranslation } from "../../../lib/i18n";
|
||||
import { stopPropagation } from "../../../lib/stopPropagation";
|
||||
|
||||
import { useIntermediate } from "../../../context/intermediate/Intermediate";
|
||||
import { modalController } from "../../../context/modals";
|
||||
import { FileUploader } from "../../../context/revoltjs/FileUploads";
|
||||
import { useClient } from "../../../context/revoltjs/RevoltClient";
|
||||
|
||||
@@ -366,10 +367,10 @@ function BotCard({ bot, onDelete, onUpdate }: Props) {
|
||||
onClick={(ev) =>
|
||||
stopPropagation(
|
||||
ev,
|
||||
openScreen({
|
||||
id: "token_reveal",
|
||||
modalController.push({
|
||||
type: "show_token",
|
||||
token: bot.token,
|
||||
username: user!.username,
|
||||
name: user!.username,
|
||||
}),
|
||||
)
|
||||
}>
|
||||
|
||||
@@ -10,12 +10,11 @@ import { urlBase64ToUint8Array } from "../../../lib/conversion";
|
||||
|
||||
import { useApplicationState } from "../../../mobx/State";
|
||||
|
||||
import { useIntermediate } from "../../../context/intermediate/Intermediate";
|
||||
import { modalController } from "../../../context/modals";
|
||||
import { AppContext } from "../../../context/revoltjs/RevoltClient";
|
||||
|
||||
export const Notifications = observer(() => {
|
||||
const client = useContext(AppContext);
|
||||
const { openScreen } = useIntermediate();
|
||||
const settings = useApplicationState().settings;
|
||||
const [pushEnabled, setPushEnabled] = useState<undefined | boolean>(
|
||||
undefined,
|
||||
@@ -52,8 +51,8 @@ export const Notifications = observer(() => {
|
||||
await Notification.requestPermission();
|
||||
|
||||
if (permission !== "granted") {
|
||||
return openScreen({
|
||||
id: "error",
|
||||
return modalController.push({
|
||||
type: "error",
|
||||
error: "DeniedNotification",
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user