Skip to content

Commit 6f43540

Browse files
committed
Add debugging helper to manually trigger error modals
1 parent 1b07864 commit 6f43540

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,13 @@ You may also need to manually run the frontend linter. First, navigate to the `f
105105
pnpm run format
106106
```
107107

108+
### Assorted Development Helpers
109+
110+
* Browser dev tools should automatically open when running `wails dev`.
111+
* You can open the URL the frontend is being served on in a browser to use browser extensions like the Svelte Devtools.
112+
Check the logs for `Using DevServer URL:` to find the correct URL.
113+
* You can manually trigger an error popup for testing purposes by running `debugCauseErrorMessage("your message here")` in the devtools console.
114+
108115
### Localization
109116

110117
If you'd like to help translate and localize SMM to different languages, join our [discord server](https://discord.ficsit.app/).

frontend/src/App.svelte

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,12 @@
122122
checkStart = $updateCheckMode === 'launch';
123123
}
124124
125+
// Allow triggering error modals from the dev console for testing
126+
// @ts-expect-error This intentionally deviates from the `window` interface
127+
window.debugCauseErrorMessage = (msg: string) => {
128+
$error = `Manually triggered error message for debugging: ${msg}`;
129+
};
130+
125131
const smmUpdateInit = smmUpdate.isInit;
126132
$: if ($smmUpdateInit && checkStart) {
127133
checkStart = false;

0 commit comments

Comments
 (0)