mirror of
https://github.com/colanode/colanode.git
synced 2025-12-29 00:25:03 +01:00
Add colanode icon
This commit is contained in:
BIN
apps/desktop/assets/colanode_logo_black.icns
Normal file
BIN
apps/desktop/assets/colanode_logo_black.icns
Normal file
Binary file not shown.
BIN
apps/desktop/assets/colanode_logo_black.ico
Normal file
BIN
apps/desktop/assets/colanode_logo_black.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.2 KiB |
BIN
apps/desktop/assets/colanode_logo_black.png
Normal file
BIN
apps/desktop/assets/colanode_logo_black.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
BIN
apps/desktop/assets/colanode_logo_white.png
Normal file
BIN
apps/desktop/assets/colanode_logo_white.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.7 KiB |
@@ -11,6 +11,9 @@ import fs from 'fs/promises';
|
||||
const config: ForgeConfig = {
|
||||
packagerConfig: {
|
||||
name: 'Colanode',
|
||||
executableName: 'Colanode',
|
||||
icon: 'assets/colanode_logo_black',
|
||||
appBundleId: 'com.colanode.desktop',
|
||||
asar: true,
|
||||
ignore: [
|
||||
/^\/src/,
|
||||
|
||||
@@ -16,9 +16,13 @@ import { commandService } from '@/main/services/command-service';
|
||||
import { bootstrapper } from '@/main/bootstrapper';
|
||||
import started from 'electron-squirrel-startup';
|
||||
import { logService } from '@/main/services/log-service';
|
||||
import { getAppIconPath } from '@/main/utils';
|
||||
|
||||
const logger = logService.createLogger('main');
|
||||
|
||||
app.setName('Colanode');
|
||||
app.setAppUserModelId('com.colanode.desktop');
|
||||
|
||||
// Handle creating/removing shortcuts on Windows when installing/uninstalling.
|
||||
if (started) {
|
||||
app.quit();
|
||||
@@ -30,6 +34,7 @@ const createWindow = () => {
|
||||
// Create the browser window.
|
||||
const mainWindow = new BrowserWindow({
|
||||
fullscreen: true,
|
||||
icon: getAppIconPath(),
|
||||
webPreferences: {
|
||||
preload: path.join(__dirname, 'preload.js'),
|
||||
},
|
||||
|
||||
@@ -4,7 +4,8 @@ import fs from 'fs';
|
||||
import unzipper from 'unzipper';
|
||||
import { EmojiData } from '@/shared/types/emojis';
|
||||
import { IconData } from '@/shared/types/icons';
|
||||
import { logService } from './log-service';
|
||||
import { logService } from '@/main/services/log-service';
|
||||
import { getAssetsSourcePath } from '@/main/utils';
|
||||
|
||||
type AssetsVersion = {
|
||||
date: string;
|
||||
@@ -34,7 +35,7 @@ class AssetService {
|
||||
return path.join(this.assetsDir, url);
|
||||
}
|
||||
|
||||
return path.join(this.getAssetsSourcePath(), url);
|
||||
return path.join(getAssetsSourcePath(), url);
|
||||
}
|
||||
|
||||
public getEmojiData(): EmojiData {
|
||||
@@ -70,7 +71,7 @@ class AssetService {
|
||||
private async updateEmojis(): Promise<void> {
|
||||
this.logger.debug('Updating emojis');
|
||||
|
||||
const emojisZipPath = path.join(this.getAssetsSourcePath(), 'emojis.zip');
|
||||
const emojisZipPath = path.join(getAssetsSourcePath(), 'emojis.zip');
|
||||
const emojisDir = path.join(this.assetsDir, 'emojis');
|
||||
if (fs.existsSync(emojisDir)) {
|
||||
fs.rmSync(emojisDir, { recursive: true });
|
||||
@@ -86,7 +87,7 @@ class AssetService {
|
||||
private async updateIcons(): Promise<void> {
|
||||
this.logger.debug('Updating icons');
|
||||
|
||||
const iconsZipPath = path.join(this.getAssetsSourcePath(), 'icons.zip');
|
||||
const iconsZipPath = path.join(getAssetsSourcePath(), 'icons.zip');
|
||||
const iconsDir = path.join(this.assetsDir, 'icons');
|
||||
if (fs.existsSync(iconsDir)) {
|
||||
fs.rmSync(iconsDir, { recursive: true });
|
||||
@@ -133,14 +134,6 @@ class AssetService {
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
private getAssetsSourcePath(): string {
|
||||
if (app.isPackaged) {
|
||||
return path.join(process.resourcesPath, 'assets');
|
||||
}
|
||||
|
||||
return path.resolve(__dirname, '../../assets');
|
||||
}
|
||||
}
|
||||
|
||||
export const assetService = new AssetService();
|
||||
|
||||
@@ -40,6 +40,18 @@ export const getAccountAvatarsDirectoryPath = (accountId: string): string => {
|
||||
return path.join(appPath, 'avatars', accountId);
|
||||
};
|
||||
|
||||
export const getAssetsSourcePath = (): string => {
|
||||
if (app.isPackaged) {
|
||||
return path.join(process.resourcesPath, 'assets');
|
||||
}
|
||||
|
||||
return path.resolve(__dirname, '../../assets');
|
||||
};
|
||||
|
||||
export const getAppIconPath = (): string => {
|
||||
return path.join(getAssetsSourcePath(), 'colanode_logo_black.png');
|
||||
};
|
||||
|
||||
export const hasInsertChanges = (result: InsertResult[]): boolean => {
|
||||
if (result.length === 0) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user