1
0
Fork 0

fix(shared): Don't make assumptions about saveAs

- Fixes #5542
- Fixes #5541
This commit is contained in:
Joost De Cock 2023-11-27 08:56:33 +01:00
parent 27aae0014f
commit 8535b7bdfd

View file

@ -104,9 +104,11 @@ export const DraftHeader = ({
* we figure out what's causing it exactly
*/
useEffect(() => {
if (saveAs.edit === 0) savePattern(true)
saveAs.edit++
}, [saveAs.edit])
if (saveAs && saveAs.edit === 0) {
savePattern(true)
saveAs.edit++
}
}, [saveAs])
const savePattern = async (silent = false) => {
if (!silent) setLoadingStatus([true, 'savingPattern'])