Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ if (process.env.NODE_ENV !== 'development') {
}

if (!chrome.runtime || !chrome.storage) {
document.body.innerHTML = '<b>Error:</b> Invalid working environment. Make sure you run it inside a Chrome extension!';
throw new Error('Invalid working environment. Make sure you run it inside a Chrome extension!');
document.body.innerHTML = '<b>Error:</b> Invalid working environment. Make sure it is running inside a Chrome extension!';
throw new Error('Invalid working environment. Make sure it is running inside a Chrome extension!');
}

createRoot(document.getElementById('luckit_app')!).render(
Expand Down
10 changes: 5 additions & 5 deletions src/screens/About.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function AboutScreen() {
<div className={cls.Title}>
<h1>luckit</h1>
<p>
unofficial Locket extension to save your friends' moments.
an unofficial Locket extension to show live photos from your friends.
</p>
<p className={cls.Version}>
version: {VERSION}
Expand All @@ -23,11 +23,11 @@ export default function AboutScreen() {
<div className={cls.Disclaimer}>
<h2>Disclaimer</h2>
<p>
This project is not affiliated with Locket or Locket Labs, Inc in anyway. By using this extension, you acknowledge that it is an unofficial Locket client, and you accept the risk that your account may be banned.
This project is not affiliated with Locket or Locket Labs, Inc in any way. By using this extension, you acknowledge that it is an unofficial Locket client, and you accept the risk that your account may be banned.
<br />
If you are not comfortable with this or you don't know what you are doing, please do not use this extension and remove it from your browser.
If you're unsure about this or you don't know what you are doing, please refrain from using this extension.
<br />
I (creator of this extension) will not be held responsible for any consequences.
I (luckit's creator) won't be held responsible for any consequences.
</p>
</div>
<div className={cls.Bruh}>
Expand All @@ -43,4 +43,4 @@ export default function AboutScreen() {
</div>
</div>
)
}
}
8 changes: 4 additions & 4 deletions src/screens/Global.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ export default function GlobalScreen() {
chrome.runtime.sendMessage({ clearAllMoments: true });
}} className={menuItemClassName}>
<AiOutlineClear />
Clear all saved moments
Clear gallery
</MenuItem>
<MenuItem onClick={() => {
chrome.runtime.sendMessage({ actionLogout: true });
mainCtx.setLoggedIn(false);
}} className={menuItemClassName}>
<HiLogout />
Logout
Log out
</MenuItem>
</SubMenu>
<MenuItem onClick={() => setSection(2)} className={menuItemClassName}>
Expand All @@ -79,7 +79,7 @@ export default function GlobalScreen() {
<RefreshMenuItem />
<MenuItem onClick={() => setSection(1)} className={menuItemClassName}>
<GrAppsRounded />
Saved moments
Gallery
</MenuItem>
<MenuItem onClick={() => setSection(3)} className={menuItemClassName}>
<HiOutlineUpload />
Expand Down Expand Up @@ -123,4 +123,4 @@ export default function GlobalScreen() {
</div>
</div>
)
}
}
24 changes: 12 additions & 12 deletions src/screens/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function LoginScreen() {
const user = await API.getAccountInfo(res.idToken);

if (!user.users[0]) {
setError("Cannot get your info, please try again");
setError("Something went wrong, please try again");
setLoading(false);
return;
}
Expand All @@ -43,17 +43,17 @@ export default function LoginScreen() {
});
return;
}
setError("Cannot login, please try again");
setError("Unable to login!");
setLoading(false);
} catch (e: any) {
const error = e as ResponseError<GenericError>;
setLoading(false);
setError(
error.error.message === 'INVALID_PASSWORD' ?
'Invalid password' : error.error.message === "EMAIL_NOT_FOUND" ? "Email not found" :
'Invalid password' : error.error.message === "EMAIL_NOT_FOUND" ? "We couldn't find your email, check again" :
error.error.message === "INVALID_EMAIL" ? "Invalid email" :
error.error.message === "USER_DISABLED" ? "User is disabled" :
"An error occurred (" + error.error.message + ")");
"We encountered an error: (" + error.error.message + ")");
}
}, [email, mainCtx, password]);

Expand All @@ -67,22 +67,22 @@ export default function LoginScreen() {
</div>
<div className={clsx(cls.LoginWarn)}>
<div className={cls.Content}>
<h1>Before you login...</h1>
<p>This project is not affiliated with Locket or Locket Labs, Inc in anyway. By using this extension, you acknowledge that it is an unofficial Locket client, and you accept the risk that your account may be banned.
<h1>Before you proceed...</h1>
<p>This project is not affiliated with Locket or Locket Labs, Inc in any way. By using this extension, you acknowledge that it is an unofficial Locket client, and you accept the risk that your account may be banned.
<br />
If you are not comfortable with this or you don't know what you are doing, please do not use this extension and remove it from your browser.
If you are unsure about this or you don't know what you are doing, please refrain from using this extension.
<br />
I (creator of this extension) will not be held responsible for any consequences.</p>
I (luckit's creator) will not be held responsible for any consequences.</p>
<button
onClick={handleLogin}
className={clsx("btn")}>
I known what I'm doing
Continue
</button>
<button
className={clsx("btn btn-soft")}
onClick={() => setShowWarn(false)}
>
Cancel
Back
</button>
</div>
</div>
Expand All @@ -94,7 +94,7 @@ export default function LoginScreen() {
<div className={cls.Title}>
<h1>welcome to luckit</h1>
<p>
login to your Locket account to continue.
please login to your Locket account.
</p>
</div>
</div>
Expand Down Expand Up @@ -133,4 +133,4 @@ export default function LoginScreen() {
</div>
</div>
)
}
}
34 changes: 17 additions & 17 deletions src/screens/Uploader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ export default function UploaderScreen() {
ok(false);
});
}) === false) {
setError("Cannot get user info");
setError("Error getting user info");
setLoading(false);
return;
}

try {
const newToken = (await API.refreshToken(refreshToken));
if (!newToken) {
setError("Cannot refresh token");
setError("Error refreshing token");
setLoading(false);
return;
}
Expand Down Expand Up @@ -88,15 +88,15 @@ export default function UploaderScreen() {
});

if (!gatherinbgUploadEnpoint.ok) {
setError("Cannot upload image due to server error");
setError("Failed to upload (server error)");
setLoading(false);
return;
}

const uploadEnpoint = gatherinbgUploadEnpoint.headers.get("X-Goog-Upload-URL");

if (!uploadEnpoint) {
setError("Cannot upload image due to invalid enpoint");
setError("Failed to upload (invalid enpoint)");
setLoading(false);
return;
}
Expand All @@ -115,7 +115,7 @@ export default function UploaderScreen() {
});

if (!uploadImage.ok) {
setError("Cannot upload image due to server error");
setError("Failed to upload (server error)");
setLoading(false);
return;
}
Expand All @@ -132,15 +132,15 @@ export default function UploaderScreen() {
});

if (!getUrl.ok) {
setError("Cannot get image url");
setError("Failed to fetch image URL");
setLoading(false);
return;
}

const imgToken = (await getUrl.json()).downloadTokens;

if (!imgToken) {
setError("Cannot get image url");
setError("Failed to fetch image URL");
setLoading(false);
return;
}
Expand All @@ -150,17 +150,17 @@ export default function UploaderScreen() {
const createPost = await API.createPost(finalImageUrl, caption);

if (!createPost) {
setError("Cannot create post");
setError("Failed to post");
setLoading(false);
return;
}

setError("Image uploaded successfully!");
setError("Done!");
setLoading(false);
handleCancel();
} catch (e: any) {
console.error(e);
setError("Cannot upload image, please see console for more info");
setError("Failed to upload, check details");
setLoading(false);
}
}, [caption, fileBuffer]);
Expand Down Expand Up @@ -190,7 +190,7 @@ export default function UploaderScreen() {

const ctx = canvas.getContext('2d');
if (!ctx) {
setError('Cannot convert image to WebP [CANVAS_NULLED]');
setError('Error converting image to WebP [CANVAS_NULLED]');
setLoading(false);
handleCancel();
return;
Expand All @@ -203,7 +203,7 @@ export default function UploaderScreen() {
if (blob) {
setFileBuffer(blob);
} else {
setError('Cannot convert image to WebP');
setError('Error converting image to WebP');
handleCancel();
}
setLoading(false);
Expand Down Expand Up @@ -232,12 +232,12 @@ export default function UploaderScreen() {
onChange={(e) => {
if (e.target.files && e.target.files[0]) {
if (e.target.files[0].size > 10 * 1024 * 1024) {
setError("File size is too large");
setError("Image size exceeded limit");
handleCancel();
return;
}
if (e.target.files[0].type !== "image/jpeg" && e.target.files[0].type !== "image/png") {
setError("File is not supported");
setError("Unsupported file");
handleCancel();
return;
}
Expand All @@ -261,8 +261,8 @@ export default function UploaderScreen() {
<div className={cls.Icon}>
<MdOutlineImage />
</div>
<h2>drag and drop or click to select image</h2>
<p>only support jpeg and png and below 10mb</p>
<h2>drag and drop or click to choose image</h2>
<p>supports jpeg/png below 10MB</p>
</div>}
</div>
<div className={clsMain.UserInfo}>
Expand All @@ -279,4 +279,4 @@ export default function UploaderScreen() {
</div>
</>
)
}
}
Loading