diff options
| author | Adam Soltys <[email protected]> | 2023-03-21 12:32:27 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-03-21 12:32:27 -0700 |
| commit | 0964394b86961e60b9aba43701fb4236e1ce5890 (patch) | |
| tree | 13a7b045539f8fe9430abd75a8de5c8a1fc0d06b /src/lib | |
| parent | b9824ce3b80f11f302458575cb90b230dbe08a37 (diff) | |
| download | coinos-ui-0964394b86961e60b9aba43701fb4236e1ce5890.tar.gz coinos-ui-0964394b86961e60b9aba43701fb4236e1ce5890.zip | |
goto / if no history
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/utils.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/utils.js b/src/lib/utils.js index 7b10c638..9b612bfd 100644 --- a/src/lib/utils.js +++ b/src/lib/utils.js @@ -181,7 +181,7 @@ export const sat = (s) => { export const sats = 100000000; -export const back = () => browser && history.go(-1); +export const back = () => browser && (history.length ? history.go(-1) : goto('/')); export const focus = (el) => browser && screen.width > 1280 && setTimeout(() => el.focus(), 1); export const sleep = (n) => new Promise((r) => setTimeout(r, n)); |
