dialog icon indicating copy to clipboard operation
dialog copied to clipboard

`showMessageBox` segfaults

Open chpio opened this issue 4 years ago • 2 comments

import dialog from "@skpm/dialog";
import iconDefault from "./assets/icon.png";

// https://stackoverflow.com/a/58718960/5572146
export function impl<T>(struct: T): T {
    return struct;
}

    await dialog.showMessageBox(impl<dialog.MessageBoxOptions>({
        type: "info",
        title: `title`,
        message: `message`,
        icon: iconDefault,
    }));
  • sketch: v70.3
  • @skpm/dialog: v0.4.1

chpio avatar Jan 25 '21 14:01 chpio

it seems to have something to do with the icon field.

after making the icon field optional (the readme says it should be optional, but it's not) and omitting it a dialog is shown.

chpio avatar Jan 25 '21 14:01 chpio

what's the error? The icon is optional (https://github.com/skpm/dialog/blob/master/lib/message-box.js#L75-L91), it looks like a mistake in the types. Happy to accept a PR to fix it

mathieudutour avatar Jan 25 '21 17:01 mathieudutour