Skip to content

Commit f1bcb30

Browse files
committed
fix: clrs
1 parent 8e14586 commit f1bcb30

5 files changed

Lines changed: 15 additions & 4 deletions

File tree

src/lib/serviceWorker.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,3 +144,8 @@ class ServiceWorkerManager {
144144

145145
// Export singleton instance
146146
export const swManager = new ServiceWorkerManager();
147+
148+
// Export cache clearing function
149+
export const clearGitHubApiCache = async (): Promise<void> => {
150+
await swManager.clearCache();
151+
};

src/lib/userSettings.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import { getFile, putFile } from './github';
55
import { parseFrontmatter, stringifyFrontmatter, safeLogError } from './utils';
6+
import { clearGitHubApiCache } from './serviceWorker';
67

78
export interface UserSettings {
89
accentColor: string; // RGB color string like "rgb(59, 130, 246)"
@@ -47,6 +48,11 @@ export async function saveUserSettings(username: string, settings: UserSettings)
4748
const path = `users/${username}-settings.md`;
4849
const content = stringifyFrontmatter(settings, '');
4950
await putFile(path, content, `Update settings for ${username}`);
51+
52+
// Clear cache to ensure fresh data on next load
53+
if (typeof clearGitHubApiCache === 'function') {
54+
await clearGitHubApiCache();
55+
}
5056
} catch (error) {
5157
safeLogError('Error saving user settings:', error);
5258
throw error;

src/pages/AdminPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export function AdminPage() {
130130
<button
131131
onClick={handleSave}
132132
disabled={isSaving}
133-
className="inline-flex items-center justify-center gap-2 rounded-xl bg-blue-600 hover:bg-blue-700 text-white px-4 py-3 text-sm font-medium transition-colors disabled:opacity-50"
133+
className="inline-flex items-center justify-center gap-2 rounded-xl btn-accent hover:opacity-90 text-white px-4 py-3 text-sm font-medium transition-colors disabled:opacity-50"
134134
>
135135
{isSaving ? 'Сохранение...' : 'Сохранить настройки'}
136136
{!isSaving && <Save className="w-4 h-4" />}

src/pages/ForumPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ export function ForumPage() {
248248
<button
249249
type="submit"
250250
disabled={isCreating}
251-
className="px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-md flex items-center gap-2 disabled:opacity-50">
251+
className="px-4 py-2 btn-accent hover:opacity-90 text-white rounded-md flex items-center gap-2 disabled:opacity-50">
252252

253253
{isCreating && <Loader2 className="w-4 h-4 animate-spin" />}
254254
{t('create')}

src/pages/HomePage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export function HomePage() {
8989
{user &&
9090
<button
9191
onClick={() => setShowCreateModal(true)}
92-
className="flex items-center gap-2 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white text-sm font-medium rounded-md transition-colors">
92+
className="flex items-center gap-2 px-4 py-2 btn-accent hover:opacity-90 text-white text-sm font-medium rounded-md transition-colors">
9393

9494
<Plus className="w-4 h-4" />
9595
{t('createBoard')}
@@ -181,7 +181,7 @@ export function HomePage() {
181181
<button
182182
type="submit"
183183
disabled={isCreating}
184-
className="px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-md flex items-center gap-2 disabled:opacity-50">
184+
className="px-4 py-2 btn-accent hover:opacity-90 text-white rounded-md flex items-center gap-2 disabled:opacity-50">
185185

186186
{isCreating && <Loader2 className="w-4 h-4 animate-spin" />}
187187
{t('create')}

0 commit comments

Comments
 (0)