prettier fix
This commit is contained in:
@@ -12,7 +12,11 @@ export class CheatingDaddyApp extends LitElement {
|
||||
static styles = css`
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
|
||||
font-family:
|
||||
'Inter',
|
||||
-apple-system,
|
||||
BlinkMacSystemFont,
|
||||
sans-serif;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
cursor: default;
|
||||
@@ -152,17 +156,14 @@ export class CheatingDaddyApp extends LitElement {
|
||||
const [config, prefs, openaiSdkCreds] = await Promise.all([
|
||||
cheatingDaddy.storage.getConfig(),
|
||||
cheatingDaddy.storage.getPreferences(),
|
||||
cheatingDaddy.storage.getOpenAISDKCredentials()
|
||||
cheatingDaddy.storage.getOpenAISDKCredentials(),
|
||||
]);
|
||||
|
||||
// Check onboarding status
|
||||
this.currentView = config.onboarded ? 'main' : 'onboarding';
|
||||
|
||||
// Apply background appearance (color + transparency)
|
||||
this.applyBackgroundAppearance(
|
||||
prefs.backgroundColor ?? '#1e1e1e',
|
||||
prefs.backgroundTransparency ?? 0.8
|
||||
);
|
||||
this.applyBackgroundAppearance(prefs.backgroundColor ?? '#1e1e1e', prefs.backgroundTransparency ?? 0.8);
|
||||
|
||||
// Load preferences
|
||||
this.selectedProfile = prefs.selectedProfile || 'interview';
|
||||
@@ -170,13 +171,13 @@ export class CheatingDaddyApp extends LitElement {
|
||||
this.selectedScreenshotInterval = prefs.selectedScreenshotInterval || '5';
|
||||
this.selectedImageQuality = prefs.selectedImageQuality || 'medium';
|
||||
this.layoutMode = config.layout || 'normal';
|
||||
|
||||
|
||||
// Load AI provider and model info
|
||||
this.aiProvider = prefs.aiProvider || 'gemini';
|
||||
this.modelInfo = {
|
||||
model: openaiSdkCreds.model || 'gpt-4o',
|
||||
visionModel: openaiSdkCreds.visionModel || 'gpt-4o',
|
||||
whisperModel: openaiSdkCreds.whisperModel || 'whisper-1'
|
||||
whisperModel: openaiSdkCreds.whisperModel || 'whisper-1',
|
||||
};
|
||||
|
||||
this._storageLoaded = true;
|
||||
@@ -191,18 +192,20 @@ export class CheatingDaddyApp extends LitElement {
|
||||
|
||||
hexToRgb(hex) {
|
||||
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
||||
return result ? {
|
||||
r: parseInt(result[1], 16),
|
||||
g: parseInt(result[2], 16),
|
||||
b: parseInt(result[3], 16)
|
||||
} : { r: 30, g: 30, b: 30 };
|
||||
return result
|
||||
? {
|
||||
r: parseInt(result[1], 16),
|
||||
g: parseInt(result[2], 16),
|
||||
b: parseInt(result[3], 16),
|
||||
}
|
||||
: { r: 30, g: 30, b: 30 };
|
||||
}
|
||||
|
||||
lightenColor(rgb, amount) {
|
||||
return {
|
||||
r: Math.min(255, rgb.r + amount),
|
||||
g: Math.min(255, rgb.g + amount),
|
||||
b: Math.min(255, rgb.b + amount)
|
||||
b: Math.min(255, rgb.b + amount),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -318,7 +321,7 @@ export class CheatingDaddyApp extends LitElement {
|
||||
this.requestUpdate();
|
||||
}
|
||||
|
||||
async handleClose() {
|
||||
async handleClose() {
|
||||
if (this.currentView === 'customize' || this.currentView === 'help' || this.currentView === 'history') {
|
||||
this.currentView = 'main';
|
||||
} else if (this.currentView === 'assistant') {
|
||||
@@ -525,11 +528,11 @@ export class CheatingDaddyApp extends LitElement {
|
||||
|
||||
render() {
|
||||
const viewClassMap = {
|
||||
'assistant': 'assistant-view',
|
||||
'onboarding': 'onboarding-view',
|
||||
'customize': 'settings-view',
|
||||
'help': 'help-view',
|
||||
'history': 'history-view',
|
||||
assistant: 'assistant-view',
|
||||
onboarding: 'onboarding-view',
|
||||
customize: 'settings-view',
|
||||
help: 'help-view',
|
||||
history: 'history-view',
|
||||
};
|
||||
const mainContentClass = `main-content ${viewClassMap[this.currentView] || 'with-border'}`;
|
||||
|
||||
@@ -598,11 +601,11 @@ export class CheatingDaddyApp extends LitElement {
|
||||
async showScreenPickerDialog() {
|
||||
const { ipcRenderer } = window.require('electron');
|
||||
const result = await ipcRenderer.invoke('get-screen-sources');
|
||||
|
||||
|
||||
if (result.success) {
|
||||
this.screenSources = result.sources;
|
||||
this.showScreenPicker = true;
|
||||
return new Promise((resolve) => {
|
||||
return new Promise(resolve => {
|
||||
this._screenPickerResolve = resolve;
|
||||
});
|
||||
} else {
|
||||
@@ -614,10 +617,10 @@ export class CheatingDaddyApp extends LitElement {
|
||||
async handleSourceSelected(event) {
|
||||
const { source } = event.detail;
|
||||
const { ipcRenderer } = window.require('electron');
|
||||
|
||||
|
||||
// Tell main process which source was selected
|
||||
await ipcRenderer.invoke('set-selected-source', source.id);
|
||||
|
||||
|
||||
this.showScreenPicker = false;
|
||||
if (this._screenPickerResolve) {
|
||||
this._screenPickerResolve({ source });
|
||||
|
||||
Reference in New Issue
Block a user