Skip to content

Commit

Permalink
offline mode display
Browse files Browse the repository at this point in the history
  • Loading branch information
Manwe-777 committed Dec 3, 2023
1 parent e104355 commit 74b7ec6
Show file tree
Hide file tree
Showing 10 changed files with 58,775 additions and 61,255 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"lodash": "^4.17.21",
"match-sorter": "^6.3.0",
"mathjs": "^9.3.0",
"mtgatool-db": "^2.1.10",
"mtgatool-db": "^2.1.11",
"mtgatool-shared": "^2.2.0",
"qrcode": "^1.5.1",
"queue": "^6.0.2",
Expand Down Expand Up @@ -201,4 +201,4 @@
"type": "git",
"url": "https://github.com/mtgatool/mtgatool-desktop.git"
}
}
}
119,970 changes: 58,736 additions & 61,234 deletions public/tooldb-worker/index.js

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion src/components/TopBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ export default function TopBar(props: TopBarProps): JSX.Element {
</div>
);

const isOffline = <div className="unlink" title="You are not logged-in." />;
const isOffline = (
<div className="unlink" title="You are not connected to any servers." />
);

return (
<div
Expand Down
2 changes: 1 addition & 1 deletion src/info.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"6.4.4","branch":"dev","timestamp":1700961911431}
{"version":"6.4.5","branch":"dev","timestamp":1701130024029}
2 changes: 1 addition & 1 deletion src/redux/slices/rendererSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const initialRendererState = {
loading: false,
logCompletion: 0,
noLog: false,
offline: false,
offline: true,
loginState: LOGIN_AUTH,
patreon: {
patreon: false,
Expand Down
10 changes: 10 additions & 0 deletions src/scss/topBar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,14 @@

.top-button-mac.close:active {
background-color: #ca4e4a;
}

.unlink {
background-repeat: no-repeat;
background-position: center;
margin-right: 0px !important;
width: 32px;
// height: 100%;
background-size: contain;
background-image: url(../assets/images/unlink.png);
}
14 changes: 7 additions & 7 deletions tooldb-worker/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tooldb-worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"license": "ISC",
"dependencies": {
"automerge": "^1.0.1-preview.7",
"mtgatool-db": "^2.1.10",
"mtgatool-db": "^2.1.11",
"mtgatool-shared": "^2.2.0"
}
}
8 changes: 7 additions & 1 deletion tooldb-worker/toolDbWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import login from "./login";
import pushToExplore from "./pushToExplore";
import pushToLiveFeed from "./pushToLivefeed";
import queryKeys from "./queryKeys";
import reduxAction from "./reduxAction";
import removeHost from "./removeHost";
import signup from "./signup";

Expand Down Expand Up @@ -73,7 +74,8 @@ toolDb.store.get(SAVED_PEERS_KEY, (err, savedData) => {

toolDb.onConnect = () => {
const networkModule = toolDb.network as ToolDbNetwork;
console.warn("ToolDb connected!");
reduxAction("SET_OFFLINE", false);

self.postMessage({ type: "CONNECTED" });
toolDb.store.put(
SERVERS_KEY,
Expand All @@ -82,6 +84,10 @@ toolDb.onConnect = () => {
);
};

toolDb.onDisconnect = () => {
reduxAction("SET_OFFLINE", true);
};

self.toolDb = toolDb;

self.globalData = {
Expand Down

0 comments on commit 74b7ec6

Please sign in to comment.