Skip to content

Commit

Permalink
Update packages, use MS Store link for checking updates (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
yell0wsuit authored Nov 9, 2024
1 parent 0b0541b commit 952aaa3
Show file tree
Hide file tree
Showing 9 changed files with 342 additions and 271 deletions.
534 changes: 304 additions & 230 deletions package-lock.json

Large diffs are not rendered by default.

36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"author": "yell0wsuit",
"description": "An English-learning interactive tool written in React, designed to help learners practice speaking and listening",
"private": true,
"version": "2.3.2",
"version": "2.3.3",
"type": "module",
"main": "main.cjs",
"license": "Apache-2.0",
Expand All @@ -23,25 +23,25 @@
"dependencies": {
"@dnd-kit/core": "^6.1.0",
"@dnd-kit/sortable": "^8.0.0",
"@react-spring/web": "^9.7.4",
"@react-spring/web": "^9.7.5",
"bootstrap": "^5.3.3",
"cors": "^2.8.5",
"dexie": "^4.0.8",
"electron-log": "^5.2.0",
"dexie": "^4.0.9",
"electron-log": "^5.2.2",
"electron-squirrel-startup": "^1.0.1",
"express": "^4.21.0",
"express": "^4.21.1",
"he": "^1.2.0",
"lodash": "^4.17.21",
"masonry-layout": "^4.2.2",
"mime": "^4.0.4",
"nprogress": "^0.2.0",
"react": "^18.3.1",
"react-bootstrap": "^2.10.4",
"react-bootstrap": "^2.10.5",
"react-bootstrap-icons": "^1.11.4",
"react-dom": "^18.3.1",
"react-flip-toolkit": "^7.2.4",
"react-loading-skeleton": "^3.5.0",
"react-router-dom": "^6.26.2"
"react-router-dom": "^6.28.0"
},
"devDependencies": {
"@electron-forge/cli": "^7.5.0",
Expand All @@ -53,20 +53,20 @@
"@electron-forge/plugin-auto-unpack-natives": "^7.5.0",
"@electron-forge/plugin-fuses": "^7.5.0",
"@electron/fuses": "^1.8.0",
"@eslint/js": "^9.11.0",
"@types/react": "^18.3.8",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.1",
"concurrently": "^9.0.1",
"@eslint/js": "^9.14.0",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@vitejs/plugin-react": "^4.3.3",
"concurrently": "^9.1.0",
"cross-env": "^7.0.3",
"electron": "^32.1.2",
"eslint": "^9.11.0",
"eslint-plugin-react": "^7.36.1",
"electron": "^33.2.0",
"eslint": "^9.14.0",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react-hooks": "^5.1.0-rc.0",
"eslint-plugin-react-refresh": "^0.4.12",
"globals": "^15.9.0",
"eslint-plugin-react-refresh": "^0.4.14",
"globals": "^15.12.0",
"rollup-plugin-visualizer": "^5.12.0",
"vite": "^5.4.7",
"vite": "^5.4.10",
"wait-on": "^8.0.1"
},
"optionalDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Homepage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function Homepage() {
};

useEffect(() => {
document.title = `Homepage | iSpeakerReact ${__APP_VERSION__}`;
document.title = `Homepage | iSpeakerReact v${__APP_VERSION__}`;
}, []);

const cardsInfo = [
Expand Down
2 changes: 1 addition & 1 deletion src/components/conversation_page/ConversationMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ const ConversationListPage = () => {
};

useEffect(() => {
document.title = `Conversations | iSpeakerReact ${__APP_VERSION__}`;
document.title = `Conversations | iSpeakerReact v${__APP_VERSION__}`;
}, []);

return (
Expand Down
2 changes: 1 addition & 1 deletion src/components/exam_page/ExamPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const ExamPage = () => {
};

useEffect(() => {
document.title = `Exams | iSpeakerReact ${__APP_VERSION__}`;
document.title = `Exams | iSpeakerReact v${__APP_VERSION__}`;
}, []);

return (
Expand Down
2 changes: 1 addition & 1 deletion src/components/exercise_page/ExercisePage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const ExercisePage = () => {
};

useEffect(() => {
document.title = `Exercises | iSpeakerReact ${__APP_VERSION__}`;
document.title = `Exercises | iSpeakerReact v${__APP_VERSION__}`;
}, []);

const ExerciseCard = ({ heading, titles, info, file }) => (
Expand Down
31 changes: 14 additions & 17 deletions src/components/setting_page/AppInfo.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useState } from "react";
import { Alert, Button, Col, Row, Spinner } from "react-bootstrap";
import { BoxArrowUpRight } from "react-bootstrap-icons";

const AppInfo = () => {
const [isLoading, setIsLoading] = useState(false);
Expand Down Expand Up @@ -44,9 +45,7 @@ const AppInfo = () => {
const latestVersion = decodedContent.version;

if (latestVersion !== currentVersion) {
const updateMessage = window.electron.isUwp()
? "A new version is available. Open the Microsoft Store app to update this app."
: "A new update is found. Go to the project's GitHub page for more information.";
const updateMessage = "A new update is found. Go to the project's GitHub page for more information.";
setAlertMessage(updateMessage);
setAlertVariant("success");
setAlertVisible(true);
Expand All @@ -71,22 +70,14 @@ const AppInfo = () => {
};

const openMsStore = () => {
window.electron.openExternal("ms-windows-store://home");
window.electron.openExternal("ms-windows-store://pdp/?productid=9NWK49GLXGFP");
};

return (
<div className="mt-4">
{alertVisible && (
<Alert variant={alertVariant} onClose={() => setAlertVisible(false)} dismissible>
{window.electron.isUwp() ? (
alertMessage.includes("Microsoft Store") ? (
<>
{alertMessage} <Alert.Link onClick={openMsStore}>Open Microsoft Store</Alert.Link>.
</>
) : (
alertMessage
)
) : alertMessage.includes("GitHub") ? (
{alertMessage.includes("GitHub") ? (
<>
{alertMessage} <Alert.Link onClick={openGithubPage}>Open GitHub</Alert.Link>.
</>
Expand All @@ -106,10 +97,16 @@ const AppInfo = () => {
<Col xs="auto" className="align-self-center h-100">
<h4 className="fw-semibold mb-2">iSpeakerReact</h4>
<p className="text-body-secondary mb-2">Version {currentVersion}</p>
<Button onClick={checkForUpdates} variant="primary">
{isLoading && <Spinner animation="border" size="sm" className="me-2" />}
Check for new updates
</Button>
{window.electron.isUwp() ? (
<Button onClick={openMsStore} variant="primary">
Check for updates in Microsoft Store <BoxArrowUpRight />
</Button>
) : (
<Button onClick={checkForUpdates} variant="primary">
{isLoading && <Spinner animation="border" size="sm" className="me-2" />}
Check for new updates
</Button>
)}
</Col>
</Row>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/setting_page/Settings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import LogSettings from "./LogSettings";

const SettingsPage = () => {
useEffect(() => {
document.title = `Settings | iSpeakerReact ${__APP_VERSION__}`;
document.title = `Settings | iSpeakerReact v${__APP_VERSION__}`;
}, []);

const [resetFlag, setResetFlag] = useState(false); // Boolean flag to force remount
Expand Down
2 changes: 1 addition & 1 deletion src/components/sound_page/SoundList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ const SoundList = () => {
}, []);

useEffect(() => {
document.title = `Sounds | iSpeakerReact ${__APP_VERSION__}`;
document.title = `Sounds | iSpeakerReact v${__APP_VERSION__}`;
}, []);

return (
Expand Down

0 comments on commit 952aaa3

Please sign in to comment.