Compare commits
214 Commits
app-v2.1.3
...
app-v2.2.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b94f7b41ac | ||
|
|
a3a23065c7 | ||
|
|
07acf57e0d | ||
|
|
16010543f5 | ||
|
|
b0ec1f63de | ||
|
|
386a47390e | ||
|
|
9b662a4333 | ||
|
|
e119b4bf0e | ||
|
|
7e58c83777 | ||
|
|
896c7d426f | ||
|
|
e3b179fa9d | ||
|
|
f5efb5664d | ||
|
|
2ae23cac2c | ||
|
|
94b24fb079 | ||
|
|
c50e3e922a | ||
|
|
9adc3a72e7 | ||
|
|
70255ef9a8 | ||
|
|
2af5cffeef | ||
|
|
0dca8768b8 | ||
|
|
5942c4ac08 | ||
|
|
3c34c6571c | ||
|
|
f5d23cc7c1 | ||
|
|
9081b440d5 | ||
|
|
db7a638729 | ||
|
|
eff85171e6 | ||
|
|
508137efde | ||
|
|
991c651082 | ||
|
|
8d91013608 | ||
|
|
9ab00bace5 | ||
|
|
88e50540e8 | ||
|
|
015a788901 | ||
|
|
c3bb662e7b | ||
|
|
638d0eec34 | ||
|
|
c5274421a5 | ||
|
|
fdafdf5dce | ||
|
|
743cf8b2af | ||
|
|
b23bd7ceb3 | ||
|
|
570c6ef730 | ||
|
|
bb7d7edad5 | ||
|
|
9a14d38e63 | ||
|
|
f65bce0de5 | ||
|
|
8005b9b86b | ||
|
|
1b4ed842a6 | ||
|
|
7cd372cc59 | ||
|
|
3b2b35d760 | ||
|
|
464e39f0d1 | ||
|
|
f66a883272 | ||
|
|
7e2172533c | ||
|
|
4237c89589 | ||
|
|
45542ce1a8 | ||
|
|
5cb286efa9 | ||
|
|
ab8284163c | ||
|
|
1ce819d324 | ||
|
|
e557afb7b2 | ||
|
|
7eb28067d8 | ||
|
|
e08a1072a7 | ||
|
|
1031206441 | ||
|
|
5a6c14b9b9 | ||
|
|
2487053341 | ||
|
|
e53ed627d6 | ||
|
|
4e66c1795c | ||
|
|
b668366d8a | ||
|
|
6caa35889a | ||
|
|
6c0f66cdd5 | ||
|
|
6d74ae4723 | ||
|
|
606e62ec3f | ||
|
|
a916982107 | ||
|
|
9f43b3d9e1 | ||
|
|
313b228e14 | ||
|
|
a180d7f7ee | ||
|
|
7bf2c309d0 | ||
|
|
bfc1fb6db5 | ||
|
|
5373630030 | ||
|
|
f82e6fc29b | ||
|
|
3390c7ad30 | ||
|
|
40401ed8ac | ||
|
|
9cdc0d343a | ||
|
|
11bb4de08b | ||
|
|
37fdfebc74 | ||
|
|
29aaed7f4b | ||
|
|
3c4e08f6a4 | ||
|
|
6718c49854 | ||
|
|
c1c34b7be3 | ||
|
|
256a9baa57 | ||
|
|
e28e8571ef | ||
|
|
ba79a7e1ff | ||
|
|
44a7cc9b2f | ||
|
|
8fb4ef7ce0 | ||
|
|
86a1d05a35 | ||
|
|
d7a50e9984 | ||
|
|
1a27221563 | ||
|
|
780d61d84a | ||
|
|
f73e5f4c51 | ||
|
|
388b1a6196 | ||
|
|
327e347ebe | ||
|
|
0e9790a721 | ||
|
|
ea81cd0e16 | ||
|
|
6b2d494f6e | ||
|
|
3866716326 | ||
|
|
8de108548c | ||
|
|
3595dae0f1 | ||
|
|
2d266508f8 | ||
|
|
833bacc65d | ||
|
|
283434aa09 | ||
|
|
87b44a6f40 | ||
|
|
f5817f4c2f | ||
|
|
8a43fd7894 | ||
|
|
a2f57095d7 | ||
|
|
1827e0da5b | ||
|
|
6993cd792d | ||
|
|
4c9454cae8 | ||
|
|
1e86025c3d | ||
|
|
af44b45ea6 | ||
|
|
4ac7384b2f | ||
|
|
83146c71c0 | ||
|
|
993d747a64 | ||
|
|
6ecc95bbb0 | ||
|
|
177e4d081f | ||
|
|
b3ed1566ca | ||
|
|
0333dcdd20 | ||
|
|
f52cd72f02 | ||
|
|
b96e383e6a | ||
|
|
feca8660f3 | ||
|
|
3c561c642a | ||
|
|
068f41f8e5 | ||
|
|
e534e65d2d | ||
|
|
9c95de2f14 | ||
|
|
0e380b72b4 | ||
|
|
4b3489f8d9 | ||
|
|
3f4bb10562 | ||
|
|
f3524bf564 | ||
|
|
8805e62f22 | ||
|
|
e825207787 | ||
|
|
e1a6dfee5d | ||
|
|
e05c7e7dd1 | ||
|
|
4743bd13e8 | ||
|
|
d8ba83e7f1 | ||
|
|
98f1cc4277 | ||
|
|
6d30154fce | ||
|
|
fc0dac1981 | ||
|
|
1cac465520 | ||
|
|
d01504cc73 | ||
|
|
6b27336c5c | ||
|
|
cc2f9342b3 | ||
|
|
198defa47b | ||
|
|
b6e4127183 | ||
|
|
abe67a2694 | ||
|
|
5a08428129 | ||
|
|
809c9e31f9 | ||
|
|
07d3e2753a | ||
|
|
f82005c573 | ||
|
|
9a2a6afadb | ||
|
|
bad410fd78 | ||
|
|
bb67f12a89 | ||
|
|
977d1da3b0 | ||
|
|
3e80669e23 | ||
|
|
a1f23efb42 | ||
|
|
4f065454c0 | ||
|
|
c31128939e | ||
|
|
a27c8dc44b | ||
|
|
3d67b0e07d | ||
|
|
d01de7337f | ||
|
|
6e1ca7987e | ||
|
|
717cf66b90 | ||
|
|
c84cc4655f | ||
|
|
28ff813c49 | ||
|
|
7cef8a3854 | ||
|
|
73a18ed957 | ||
|
|
69a7938955 | ||
|
|
808aaea818 | ||
|
|
57d8928966 | ||
|
|
e46655654b | ||
|
|
0c1508f761 | ||
|
|
a2ee25b559 | ||
|
|
a3968bf9f7 | ||
|
|
799a626005 | ||
|
|
154d398724 | ||
|
|
a7005b91da | ||
|
|
6b508d472f | ||
|
|
9266b43c7a | ||
|
|
5721a7eecb | ||
|
|
7f2f09137c | ||
|
|
3b80fe6cdf | ||
|
|
b995c8c564 | ||
|
|
f13517d75b | ||
|
|
06945b7a3c | ||
|
|
8beaf37f5a | ||
|
|
8cb9f006de | ||
|
|
0f2c818cb2 | ||
|
|
fcfedce514 | ||
|
|
c2541eb2ac | ||
|
|
8262784152 | ||
|
|
13bfba8f22 | ||
|
|
e708a779c7 | ||
|
|
f93cca8043 | ||
|
|
e3133749f7 | ||
|
|
0e870dbb1b | ||
|
|
8911232658 | ||
|
|
b8abcd1848 | ||
|
|
ea69588488 | ||
|
|
f32243a402 | ||
|
|
80a5d4eea5 | ||
|
|
40a663ad21 | ||
|
|
6aa42d4ee0 | ||
|
|
f57289cc46 | ||
|
|
f84e74f230 | ||
|
|
55ed97bfeb | ||
|
|
e4320d9a16 | ||
|
|
01e43a9223 | ||
|
|
f204afdc6d | ||
|
|
5b9ffe320a | ||
|
|
e291c110fe | ||
|
|
3b83839f6c | ||
|
|
26f6e97ad8 |
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"outDir": "dist/app"
|
||||
}
|
||||
11
.github/FUNDING.yml
vendored
@@ -1,12 +1,5 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||
github: Timeraa
|
||||
patreon: Timeraa
|
||||
open_collective: premid
|
||||
ko_fi: timeraa
|
||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
liberapay: # Replace with a single Liberapay username
|
||||
issuehunt: # Replace with a single IssueHunt username
|
||||
otechie: # Replace with a single Otechie username
|
||||
custom: https://paypal.me/TimeraaDEV
|
||||
ko_fi: Timeraa
|
||||
|
||||
28
.github/workflows/deploy.yml
vendored
@@ -26,9 +26,9 @@ jobs:
|
||||
node util/zip dist ${{ matrix.os }}.zip --zip
|
||||
- name: Upload bundle
|
||||
env:
|
||||
SSHHOST: ${{ secrets.SSHHOST }}
|
||||
SSHUSERNAME: ${{ secrets.SSHUSERNAME }}
|
||||
SSHPASSWORD: ${{ secrets.SSHPASSWORD }}
|
||||
SSHHOST: ${{ secrets.MAIN_HOST }}
|
||||
SSH_USERNAME: ${{ secrets.SSH_USERNAME }}
|
||||
SSHKEY: ${{ secrets.SSH_KEY }}
|
||||
run: |
|
||||
tsc util/uploadFile util/zip
|
||||
node util/uploadFile ${{ matrix.os }}.zip /home/PreMiD/download/util/${{ matrix.os }}.zip
|
||||
@@ -40,15 +40,15 @@ jobs:
|
||||
- uses: actions/setup-node@master
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
npm i
|
||||
npm i -g typescript
|
||||
sudo npm i
|
||||
sudo npm i -g typescript
|
||||
- name: Download InstallBuilder
|
||||
run: |
|
||||
wget https://clients.bitrock.com/installbuilder/installbuilder-enterprise-19.10.0-linux-x64-installer.run
|
||||
chmod u+x installbuilder-enterprise-19.10.0-linux-x64-installer.run
|
||||
wget https://clients.bitrock.com/installbuilder/installbuilder-enterprise-20.12.0-linux-x64-installer.run
|
||||
chmod u+x installbuilder-enterprise-20.12.0-linux-x64-installer.run
|
||||
- name: Install InstallBuilder
|
||||
run: |
|
||||
./installbuilder-enterprise-19.10.0-linux-x64-installer.run --installer-language en --prefix ./installbuilder --mode unattended
|
||||
./installbuilder-enterprise-20.12.0-linux-x64-installer.run --installer-language en --prefix ./installbuilder --mode unattended
|
||||
echo "${{ secrets.IBLICENSE }}" > ./installbuilder/license.xml
|
||||
- name: Prepare Upgrade Installer
|
||||
run: |
|
||||
@@ -62,9 +62,9 @@ jobs:
|
||||
installbuilder/bin/builder build installer_assets/PreMiD-Upgrade.xml windows
|
||||
- name: Upload files
|
||||
env:
|
||||
SSHHOST: ${{ secrets.SSHHOST }}
|
||||
SSHUSERNAME: ${{ secrets.SSHUSERNAME }}
|
||||
SSHPASSWORD: ${{ secrets.SSHPASSWORD }}
|
||||
SSHHOST: ${{ secrets.MAIN_HOST }}
|
||||
SSH_USERNAME: ${{ secrets.SSH_USERNAME }}
|
||||
SSHKEY: ${{ secrets.SSH_KEY }}
|
||||
run: |
|
||||
tsc util/uploadFile util/zip
|
||||
node util/uploadFile dist/installer/upgrader.exe /home/PreMiD/download/upgrader.exe
|
||||
@@ -72,9 +72,9 @@ jobs:
|
||||
- name: Finalize build
|
||||
uses: appleboy/ssh-action@master
|
||||
with:
|
||||
host: ${{ secrets.SSHHOST }}
|
||||
username: ${{ secrets.SSHUSERNAME }}
|
||||
password: ${{ secrets.SSHPASSWORD }}
|
||||
host: ${{ secrets.MAIN_HOST }}
|
||||
username: ${{ secrets.SSH_USERNAME }}
|
||||
key: ${{ secrets.SSH_KEY }}
|
||||
script: |
|
||||
cd /home/PreMiD/download/util
|
||||
unzip upgrader.app.zip
|
||||
|
||||
6
.gitignore
vendored
@@ -5,6 +5,10 @@ tmp
|
||||
|
||||
.vscode
|
||||
.env
|
||||
.yarn/*
|
||||
!.yarn/releases
|
||||
!.yarn/plugins
|
||||
.pnp.*
|
||||
|
||||
src/package-lock.json
|
||||
src/package.json
|
||||
@@ -13,4 +17,4 @@ src/update.ini
|
||||
*.exe
|
||||
*.app
|
||||
*.xml.backup
|
||||
*.js
|
||||
*.js
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||

|
||||
[](https://chrome.google.com/webstore/detail/premid/agjnjboanicjcpenljmaaigopkgdnihi)
|
||||

|
||||

|
||||

|
||||
[](https://app.fossa.io/projects/git%2Bgithub.com%2FPreMiD%2FPreMiD?ref=badge_shield)
|
||||
|
||||
<img src=".github/example.png" draggable="false"><br>
|
||||
@@ -38,8 +36,8 @@
|
||||
<a target="_blank" href="https://www.patreon.com/bePatron?u=4610890" data-patreon-widget-type="become-patron-button" title="Support me on Patreon!">
|
||||
<img height="75px" draggable="false" src=".github/Patreon.png">
|
||||
</a>
|
||||
<a target="_blank" href="https://discord.gg/WvfVZ8T" title="Join our Discord!">
|
||||
<img height="75px" draggable="false" src="https://discordapp.com/api/guilds/493130730549805057/widget.png?style=banner2" alt="Join my Discord!">
|
||||
<a target="_blank" href="https://discord.premid.app/" title="Join our Discord!">
|
||||
<img src="https://discordapp.com/api/guilds/493130730549805057/widget.png?style=banner2" height="76px" draggable="false" alt="Join our Discord!">
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
65
package.json
@@ -2,54 +2,55 @@
|
||||
"name": "premid",
|
||||
"productName": "PreMiD",
|
||||
"description": "Discord Rich Presence for web services.",
|
||||
"version": "2.1.3",
|
||||
"version": "2.2.0",
|
||||
"repository": "https://github.com/PreMiD/PreMiD",
|
||||
"scripts": {
|
||||
"init": "tsc --skipLibCheck && tsc pkg util/prepare util/zip && devScript --copyOnly",
|
||||
"start": "devScript --copyOnly && electron dist/app/.",
|
||||
"dev": "nodemon --exec yarn start -S --watch dist/app -e .js",
|
||||
"start": "electron dist/app/. --unhandled-rejections=strict",
|
||||
"dev": "devscript --depCheck",
|
||||
"pkg": "rimraf dist && tsc --skipLibCheck && devScript --copyOnly && cd dist/app/ && yarn && cd ../../ && node pkg",
|
||||
"deploy": "tsc --skipLibCheck .github/deploy && cd .github && node deploy.js"
|
||||
},
|
||||
"license": "MIT",
|
||||
"license": "MPL-2.0",
|
||||
"devDependencies": {
|
||||
"@timeraa/devscript": "Timeraa/DevScript",
|
||||
"@types/archiver": "3.1.0",
|
||||
"@types/archiver": "5.1.0",
|
||||
"@types/auto-launch": "5.0.1",
|
||||
"@types/discord-rpc": "3.0.2",
|
||||
"@types/electron-packager": "14.0.0",
|
||||
"@types/fs-extra": "8.1.0",
|
||||
"@types/discord-rpc": "3.0.4",
|
||||
"@types/fs-extra": "9.0.7",
|
||||
"@types/ini": "1.3.30",
|
||||
"@types/node": "13.11.0",
|
||||
"@types/prompts": "2.0.5",
|
||||
"@types/node": "14.14.31",
|
||||
"@types/prompts": "2.0.9",
|
||||
"@types/request-promise-native": "1.0.17",
|
||||
"@types/rimraf": "3.0.0",
|
||||
"@types/socket.io": "2.1.4",
|
||||
"@types/ssh2-sftp-client": "4.1.3",
|
||||
"@types/socket.io": "2.1.13",
|
||||
"@types/ssh2-sftp-client": "5.3.1",
|
||||
"@types/unzipper": "^0.10.3",
|
||||
"archiver": "3.1.1",
|
||||
"chalk": "4.0.0",
|
||||
"electron": "8.2.1",
|
||||
"electron-packager": "14.2.1",
|
||||
"fast-glob": "3.2.2",
|
||||
"fs-extra": "9.0.0",
|
||||
"nodemon": "2.0.2",
|
||||
"ora": "4.0.3",
|
||||
"prompts": "2.3.2",
|
||||
"archiver": "5.2.0",
|
||||
"chalk": "4.1.0",
|
||||
"electron": "11.3.0",
|
||||
"electron-packager": "15.2.0",
|
||||
"fast-glob": "3.2.5",
|
||||
"fs-extra": "9.1.0",
|
||||
"nodemon": "2.0.7",
|
||||
"ora": "5.3.0",
|
||||
"prompts": "2.4.0",
|
||||
"rimraf": "3.0.2",
|
||||
"ssh2-sftp-client": "5.1.2",
|
||||
"typescript": "3.8.3",
|
||||
"unzipper": "0.10.10",
|
||||
"yarn": "1.22.4"
|
||||
"ssh2-sftp-client": "6.0.1",
|
||||
"ts-devscript": "^3.0.3",
|
||||
"typescript": "4.1.5",
|
||||
"unzipper": "0.10.11",
|
||||
"yarn": "1.22.10"
|
||||
},
|
||||
"dependencies": {
|
||||
"@sentry/electron": "1.3.0",
|
||||
"auto-launch": "5.0.5",
|
||||
"axios": "0.19.2",
|
||||
"chokidar": "3.3.1",
|
||||
"axios": "0.21.1",
|
||||
"chokidar": "3.5.1",
|
||||
"discord-rpc": "github:discordjs/RPC",
|
||||
"electron-store": "5.1.1",
|
||||
"socket.io": "2.3.0",
|
||||
"source-map-support": "^0.5.16"
|
||||
"electron-store": "7.0.2",
|
||||
"socket.io": "3.1.1",
|
||||
"source-map-support": "^0.5.19"
|
||||
},
|
||||
"devScript": {
|
||||
"out": "dist/app"
|
||||
}
|
||||
}
|
||||
|
||||
BIN
src/assets/tray/Icon.ico
Normal file
|
After Width: | Height: | Size: 402 KiB |
BIN
src/assets/tray/Icon@1.25x.png
Normal file
|
After Width: | Height: | Size: 384 B |
BIN
src/assets/tray/Icon@1.5x.png
Normal file
|
After Width: | Height: | Size: 445 B |
BIN
src/assets/tray/Icon@1.8x.png
Normal file
|
After Width: | Height: | Size: 481 B |
BIN
src/assets/tray/Icon@16x.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
src/assets/tray/Icon@2.5x.png
Normal file
|
After Width: | Height: | Size: 592 B |
|
Before Width: | Height: | Size: 547 B After Width: | Height: | Size: 506 B |
BIN
src/assets/tray/Icon@3x.png
Normal file
|
After Width: | Height: | Size: 688 B |
BIN
src/assets/tray/Icon@4x.png
Normal file
|
After Width: | Height: | Size: 858 B |
BIN
src/assets/tray/Icon@5x.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
src/assets/tray/Icon@8x.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 880 B After Width: | Height: | Size: 343 B |
1
src/assets/tray/icon.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" id="Слой_1" data-name="Слой 1" viewBox="0 0 512 512"><defs><style>.cls-1{fill:#fff;fill-rule:evenodd}</style></defs><title>pmd_logo_1</title><path d="M459.17,105H52.83a30.35,30.35,0,0,0-30.34,30.34V376.66A30.35,30.35,0,0,0,52.83,407H459.17a30.35,30.35,0,0,0,30.34-30.34V135.34A30.35,30.35,0,0,0,459.17,105Zm-185,94.4a13.93,13.93,0,0,1,9.9-4.11h90.29a14,14,0,0,1,0,28H284a14,14,0,0,1-9.9-23.91Zm-63.64,63.11L92.14,330.83a7.51,7.51,0,0,1-11.27-6.51V187.68a7.51,7.51,0,0,1,11.27-6.51l118.34,68.32A7.52,7.52,0,0,1,210.48,262.51ZM441.81,312.6a13.93,13.93,0,0,1-9.9,4.11H284a14,14,0,0,1,0-28H431.91a14,14,0,0,1,9.9,23.91Zm0-46.7a13.93,13.93,0,0,1-9.9,4.11H284a14,14,0,0,1,0-28H431.91a14,14,0,0,1,9.9,23.91Z" class="cls-1"/></svg>
|
||||
|
After Width: | Height: | Size: 771 B |
BIN
src/assets/tray/windows_icon.xcf
Normal file
25
src/index.ts
@@ -1,24 +1,26 @@
|
||||
import "source-map-support/register";
|
||||
|
||||
import { app } from "electron";
|
||||
import { init as initSocket } from "./managers/socketManager";
|
||||
import { update as initAutoLaunch } from "./managers/launchManager";
|
||||
import { platform } from "os";
|
||||
import { checkForUpdate } from "./util/updateChecker";
|
||||
import { TrayManager } from "./managers/trayManager";
|
||||
import * as Sentry from "@sentry/electron";
|
||||
|
||||
if (app.isPackaged)
|
||||
Sentry.init({
|
||||
dsn:
|
||||
"https://c11e044610da45b7a4dc3bac6c006037@o357239.ingest.sentry.io/5193608"
|
||||
});
|
||||
import { update as initAutoLaunch } from "./managers/launchManager";
|
||||
import { init as initSocket } from "./managers/socketManager";
|
||||
import { TrayManager } from "./managers/trayManager";
|
||||
import { checkForUpdate } from "./util/updateChecker";
|
||||
|
||||
export let trayManager: TrayManager;
|
||||
|
||||
//* Define and set it to null
|
||||
//* Set AppUserModelId for task manager etc
|
||||
//* When app is ready
|
||||
export let updateCheckerInterval = null;
|
||||
|
||||
//* Attempt to get lock to prevent multiple instances of PreMiD from running
|
||||
let singleInstanceLock = app.requestSingleInstanceLock();
|
||||
|
||||
//* Application already running?
|
||||
if (!singleInstanceLock) app.quit();
|
||||
|
||||
app.setAppUserModelId("Timeraa.PreMiD");
|
||||
app.whenReady().then(async () => {
|
||||
trayManager = new TrayManager();
|
||||
@@ -30,6 +32,3 @@ app.whenReady().then(async () => {
|
||||
: undefined;
|
||||
if (platform() === "darwin") app.dock.hide();
|
||||
});
|
||||
|
||||
//* If second instance started, close old one
|
||||
app.on("second-instance", () => app.exit(0));
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { Client } from "discord-rpc";
|
||||
import { app } from "electron";
|
||||
import { info } from "../util/debug";
|
||||
|
||||
import { trayManager } from "../";
|
||||
//* Import custom types
|
||||
import PresenceData from "../../@types/PreMiD/PresenceData";
|
||||
import { trayManager } from "..";
|
||||
import { info } from "../util/debug";
|
||||
|
||||
export let rpcClients: Array<RPCClient> = [];
|
||||
|
||||
@@ -66,8 +66,10 @@ class RPCClient {
|
||||
async destroy() {
|
||||
try {
|
||||
info(`Destroy RPC client (${this.clientId})`);
|
||||
this.client.clearActivity();
|
||||
this.client.destroy();
|
||||
if (this.clientReady) {
|
||||
this.client.clearActivity();
|
||||
this.client.destroy();
|
||||
}
|
||||
|
||||
trayManager.tray.setTitle("");
|
||||
rpcClients = rpcClients.filter(
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
import socketIo from "socket.io";
|
||||
import { createServer, Server } from "http";
|
||||
import { app, dialog } from "electron";
|
||||
import { success, error } from "../util/debug";
|
||||
import { update as updateSettings } from "./settingsManager";
|
||||
import { createServer, Server } from "http";
|
||||
import socketIo from "socket.io";
|
||||
|
||||
import { trayManager } from "../";
|
||||
import { error, success } from "../util/debug";
|
||||
import { clearActivity, getDiscordUser, rpcClients, setActivity } from "./discordManager";
|
||||
import { openFileDialog } from "./presenceDevManager";
|
||||
import {
|
||||
rpcClients,
|
||||
setActivity,
|
||||
clearActivity,
|
||||
getDiscordUser
|
||||
} from "./discordManager";
|
||||
import { trayManager } from "..";
|
||||
import { update as updateSettings } from "./settingsManager";
|
||||
|
||||
export let io: socketIo.Server;
|
||||
export let socket: socketIo.Socket;
|
||||
@@ -18,14 +14,18 @@ export let server: Server;
|
||||
export let connected: boolean = false;
|
||||
|
||||
export function init() {
|
||||
return new Promise(resolve => {
|
||||
return new Promise<void>(resolve => {
|
||||
//* Create server
|
||||
//* create SocketIo server, don't server client
|
||||
//* Try to listen to port 3020
|
||||
//* If that fails/some other error happens run socketError
|
||||
//* If someone connects to socket socketConnection
|
||||
server = createServer();
|
||||
io = socketIo(server, { serveClient: false });
|
||||
io = new socketIo.Server(server, {
|
||||
serveClient: false,
|
||||
allowEIO3: true,
|
||||
cors: { origin: "*" }
|
||||
});
|
||||
server.listen(3020, () => {
|
||||
//* Resolve promise
|
||||
//* Debug info
|
||||
|
||||
@@ -1,14 +1,25 @@
|
||||
import { Menu, Tray, app, shell } from "electron";
|
||||
import { app, Menu, shell, Tray } from "electron";
|
||||
import { platform } from "os";
|
||||
import { join } from "path";
|
||||
import { trayManager } from "..";
|
||||
|
||||
import { trayManager } from "../";
|
||||
import { checkForUpdate, update, updateAvailable } from "../util/updateChecker";
|
||||
import { connected } from "./socketManager";
|
||||
import { platform } from "os";
|
||||
|
||||
let trayIcon =
|
||||
platform() === "darwin"
|
||||
? join(__dirname, "../assets/tray/IconTemplate.png")
|
||||
: join(__dirname, "../assets/tray/Icon@2x.png");
|
||||
let trayIcon;
|
||||
|
||||
switch (platform()) {
|
||||
case "darwin":
|
||||
trayIcon = join(__dirname, "../assets/tray/IconTemplate.png");
|
||||
break;
|
||||
case "win32":
|
||||
trayIcon = join(__dirname, "../assets/tray/Icon.ico");
|
||||
break;
|
||||
default:
|
||||
trayIcon = join(__dirname, "../assets/tray/Icon@4x.png");
|
||||
break;
|
||||
}
|
||||
|
||||
export class TrayManager {
|
||||
tray: Tray;
|
||||
|
||||
@@ -26,7 +37,7 @@ export class TrayManager {
|
||||
icon:
|
||||
platform() === "darwin"
|
||||
? join(__dirname, "../assets/tray/IconTemplate.png")
|
||||
: join(__dirname, "../assets/tray/Icon.png"),
|
||||
: join(__dirname, "../assets/tray/Icon@4x.png"),
|
||||
label: `${app.name} v${app.getVersion()}`,
|
||||
enabled: false
|
||||
},
|
||||
@@ -46,17 +57,17 @@ export class TrayManager {
|
||||
type: "separator"
|
||||
},
|
||||
{
|
||||
label: `Update ${app.name}`,
|
||||
label: `Update ${app.name}!`,
|
||||
visible: updateAvailable,
|
||||
click: () => update()
|
||||
},
|
||||
{
|
||||
label: "Check for Updates...",
|
||||
label: "Check for Updates",
|
||||
click: () => checkForUpdate(false, true),
|
||||
visible: !updateAvailable
|
||||
},
|
||||
{
|
||||
label: "Acknowledgments",
|
||||
label: "Contributors",
|
||||
click: () => shell.openExternal("https://premid.app/contributors")
|
||||
},
|
||||
{
|
||||
@@ -71,4 +82,4 @@ export class TrayManager {
|
||||
}
|
||||
}
|
||||
|
||||
app.once("quit", () => trayManager.tray.destroy());
|
||||
app.once("quit", () => trayManager?.tray.destroy());
|
||||
|
||||
@@ -5,8 +5,8 @@ let sftp = new Client();
|
||||
sftp
|
||||
.connect({
|
||||
host: process.env.SSHHOST,
|
||||
username: process.env.SSHUSERNAME,
|
||||
password: process.env.SSHPASSWORD
|
||||
username: process.env.SSH_USERNAME,
|
||||
privateKey: process.env.SSH_KEY
|
||||
})
|
||||
.then(async () => {
|
||||
sftp
|
||||
|
||||