fix: set proper error toast

This commit is contained in:
sevichecc 2023-04-14 14:25:08 +08:00
parent 7d9cf2509b
commit 803283e037
Signed by untrusted user who does not match committer: SevicheCC
GPG key ID: C577000000000000

View file

@ -1,5 +1,5 @@
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { Form, ActionPanel, Action, showToast, popToRoot, LaunchProps } from "@raycast/api"; import { Form, ActionPanel, Action, showToast, popToRoot, LaunchProps,Toast } from "@raycast/api";
import { postNewStatus } from "./api"; import { postNewStatus } from "./api";
import { Status } from "./types"; import { Status } from "./types";
import { authorize } from "./oauth"; import { authorize } from "./oauth";
@ -33,7 +33,7 @@ export default function Command(props: LaunchProps<{ draftValues: Partial<Status
popToRoot(); popToRoot();
} catch (error) { } catch (error) {
console.error(error); console.error(error);
showToast({ title: "Error", message: "Something went wrong!" }); showToast({ title: "Error", message: "Something went wrong!", style: Toast.Style.Failure });
} }
}; };