Skip to content

Commit

Permalink
Revert "added ability to change icon to unread"
Browse files Browse the repository at this point in the history
This reverts commit 3ccb0c4.
  • Loading branch information
PolisanTheEasyNick committed Apr 18, 2024
1 parent 3ccb0c4 commit d7c9cd0
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 15 deletions.
5 changes: 1 addition & 4 deletions src/main/mainWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { isTruthy } from "shared/utils/guards";
import { once } from "shared/utils/once";
import type { SettingsStore } from "shared/utils/SettingsStore";

import { DEAFENED_ICON_PATH, ICON_PATH, IDLE_ICON_PATH, MUTED_ICON_PATH, SPEAKING_ICON_PATH, UNREAD_ICON_PATH } from "shared/paths";
import { DEAFENED_ICON_PATH, ICON_PATH, IDLE_ICON_PATH, MUTED_ICON_PATH, SPEAKING_ICON_PATH } from "../shared/paths";
import { createAboutWindow } from "./about";
import { initArRPC } from "./arrpc";
import {
Expand Down Expand Up @@ -491,9 +491,6 @@ export async function setTrayIcon(iconName) {
case "deafened":
tray.setImage(DEAFENED_ICON_PATH);
break;
case "unread":
tray.setImage(UNREAD_ICON_PATH);
break;
case "idle":
tray.setImage(IDLE_ICON_PATH);
break;
Expand Down
7 changes: 1 addition & 6 deletions src/renderer/appBadge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { filters, waitFor } from "@vencord/types/webpack";
import { RelationshipStore } from "@vencord/types/webpack/common";

import { Settings } from "./settings";
import { isInVC } from "./patches/tray";

let GuildReadStateStore: any;
let NotificationSettingsStore: any;
Expand All @@ -24,12 +23,8 @@ export function setBadge() {

let totalCount = mentionCount + pendingRequests;
if (!totalCount && hasUnread && !disableUnreadBadge) totalCount = -1;

VesktopNative.app.setBadgeCount(totalCount);
if(totalCount > 0 && !isInVC) {
VesktopNative.app.setTrayIcon("unread");
} else if (!isInVC) {
VesktopNative.app.setTrayIcon("main");
}
} catch (e) {
console.error(e);
}
Expand Down
4 changes: 0 additions & 4 deletions src/renderer/patches/tray.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import { FluxDispatcher, UserStore } from "@vencord/types/webpack/common";
const muteActions = findByPropsLazy("isSelfMute");
const deafActions = findByPropsLazy("isSelfDeaf");

export var isInVC = false;

onceReady.then(() => {
const userID = UserStore.getCurrentUser().id;

Expand Down Expand Up @@ -51,7 +49,6 @@ onceReady.then(() => {

FluxDispatcher.subscribe("RTC_CONNECTION_STATE", params => {
if (params.state === "RTC_CONNECTED") {
isInVC = true;
if (deafActions.isSelfDeaf()) {
VesktopNative.app.setTrayIcon("deafened");
} else if (muteActions.isSelfMute()) {
Expand All @@ -60,7 +57,6 @@ onceReady.then(() => {
VesktopNative.app.setTrayIcon("idle");
}
} else if (params.state === "RTC_DISCONNECTED") {
isInVC = false;
VesktopNative.app.setTrayIcon("main");
}
});
Expand Down
1 change: 0 additions & 1 deletion src/shared/paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ export const SPEAKING_ICON_PATH = /* @__PURE__ */ join(STATIC_DIR, "speaking.png
export const MUTED_ICON_PATH = /* @__PURE__ */ join(STATIC_DIR, "muted.png");
export const DEAFENED_ICON_PATH = /* @__PURE__ */ join(STATIC_DIR, "deafened.png");
export const IDLE_ICON_PATH = /* @__PURE__ */ join(STATIC_DIR, "idle.png");
export const UNREAD_ICON_PATH = /* @__PURE__ */ join(STATIC_DIR, "unread.png");
Binary file removed static/unread.png
Binary file not shown.

0 comments on commit d7c9cd0

Please sign in to comment.