mirror of
https://github.com/ramvignesh-b/pi-ku.git
synced 2026-05-04 19:10:52 +00:00
refactor: simplify logical expressions and update biome linting rules
This commit is contained in:
@@ -15,7 +15,7 @@ export default function Activate() {
|
||||
const navigate = useNavigate();
|
||||
|
||||
useEffect(() => {
|
||||
if (!uidb64 || !token || hasCalled.current) return;
|
||||
if (!(uidb64 && token) || hasCalled.current) return;
|
||||
|
||||
// prevent double api calls
|
||||
hasCalled.current = true;
|
||||
|
||||
@@ -36,7 +36,7 @@ export default function Editor() {
|
||||
const fileInputRef = useRef<HTMLInputElement>(null);
|
||||
|
||||
useEffect(() => {
|
||||
if (!public_id || !masterKey) return;
|
||||
if (!(public_id && masterKey)) return;
|
||||
|
||||
const loadExistingLetter = async () => {
|
||||
setIsInitialLoading(true);
|
||||
@@ -95,7 +95,7 @@ export default function Editor() {
|
||||
};
|
||||
|
||||
const handleSave = async (status: "SEALED" | "DRAFT"): Promise<void> => {
|
||||
if (!public_id && !letterIdRef.current) {
|
||||
if (!(public_id || letterIdRef.current)) {
|
||||
letterIdRef.current = crypto.randomUUID();
|
||||
navigate(PATHS.write(letterIdRef.current), { replace: true });
|
||||
} else if (public_id) {
|
||||
|
||||
Reference in New Issue
Block a user