viewRaw: dont add context menu to guild folders (#1708)

This commit is contained in:
AutumnVN 2023-09-06 23:51:18 +07:00 committed by GitHub
parent 315fcf1972
commit a4cadc03d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -119,6 +119,7 @@ const settings = definePluginSettings({
function MakeContextCallback(name: string) { function MakeContextCallback(name: string) {
const callback: NavContextMenuPatchCallback = (children, props) => () => { const callback: NavContextMenuPatchCallback = (children, props) => () => {
if (name === "Guild" && !props.guild) return;
const lastChild = children.at(-1); const lastChild = children.at(-1);
if (lastChild?.key === "developer-actions") { if (lastChild?.key === "developer-actions") {
const p = lastChild.props; const p = lastChild.props;