Files
spacedrive/interface/util/index.tsx
ameer2468 0a4c1f41e7 Job Manager improvement & refactor (#783)
* d

* wip

* Nit: margin and padding tweak

* UI design tweaks

* Update Job.tsx

* Improve UI

* [WIP] - Refactor job manager

* remove invalidate explorer event on thumb generation. the event above performs atomic updates on the front end when new thumbnails are generated, now just need to make that work

* prettier formatting + removed unused imports

* UI tweaks

* progress bar width adjustment

* tweaks

* fix em

* fix thumbnail generation

* fix progress bar

* fix time

---------

Co-authored-by: Jamie Pine <ijamespine@me.com>
Co-authored-by: Brendan Allan <brendonovich@outlook.com>
Co-authored-by: Oscar Beaumont <oscar@otbeaumont.me>
2023-05-08 22:31:49 +00:00

12 lines
420 B
TypeScript

import cryptoRandomString from 'crypto-random-string';
import { useCallback, useState } from 'react';
// NOTE: `crypto` module is not available in RN so this can't be in client
export const generatePassword = (length: number) =>
cryptoRandomString({ length, type: 'ascii-printable' });
export function useForceUpdate() {
const [, setTick] = useState(0);
return useCallback(() => setTick((tick) => tick + 1), []);
}