Browse Source

chore: remove saveMySettings that depended on an implicit variable

pull/202/head
Trent Larson 3 weeks ago
parent
commit
c0f407eb72
  1. 2
      src/components/TopMessage.vue
  2. 2
      src/services/migrationService.ts
  3. 9
      src/utils/PlatformServiceMixin.ts
  4. 4
      src/views/HomeView.vue

2
src/components/TopMessage.vue

@ -28,7 +28,7 @@ import { logger } from "../utils/logger";
export default class TopMessage extends Vue { export default class TopMessage extends Vue {
// Enhanced PlatformServiceMixin v4.0 provides: // Enhanced PlatformServiceMixin v4.0 provides:
// - Cached database operations: this.$contacts(), this.$settings(), this.$accountSettings() // - Cached database operations: this.$contacts(), this.$settings(), this.$accountSettings()
// - Settings shortcuts: this.$saveSettings(), this.$saveMySettings() // - Settings shortcuts: this.$saveSettings()
// - Cache management: this.$refreshSettings(), this.$clearAllCaches() // - Cache management: this.$refreshSettings(), this.$clearAllCaches()
// - Ultra-concise database methods: this.$db(), this.$exec(), this.$query() // - Ultra-concise database methods: this.$db(), this.$exec(), this.$query()
// - All methods use smart caching with TTL for massive performance gains // - All methods use smart caching with TTL for massive performance gains

2
src/services/migrationService.ts

@ -799,7 +799,7 @@ export async function runMigrations<T>(
} }
// Only show completion message in development // Only show completion message in development
logger.debug( logger.log(
`🎉 [Migration] Migration process complete! Summary: ${appliedCount} applied, ${skippedCount} skipped`, `🎉 [Migration] Migration process complete! Summary: ${appliedCount} applied, ${skippedCount} skipped`,
); );
} catch (error) { } catch (error) {

9
src/utils/PlatformServiceMixin.ts

@ -1212,6 +1212,11 @@ export const PlatformServiceMixin = {
* @param changes Settings changes to save * @param changes Settings changes to save
* @returns Promise<boolean> Success status * @returns Promise<boolean> Success status
*/ */
/**
* Since this is unused, and since it relies on this.activeDid which isn't guaranteed to exist,
* let's take this out for the sake of safety.
* Totally remove after start of 2026 (since it would be obvious by then that it's not used).
*
async $saveMySettings(changes: Partial<Settings>): Promise<boolean> { async $saveMySettings(changes: Partial<Settings>): Promise<boolean> {
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
const currentDid = (this as any).activeDid; const currentDid = (this as any).activeDid;
@ -1221,6 +1226,7 @@ export const PlatformServiceMixin = {
} }
return await this.$saveUserSettings(currentDid, changes); return await this.$saveUserSettings(currentDid, changes);
}, },
**/
// ================================================= // =================================================
// CACHE MANAGEMENT METHODS // CACHE MANAGEMENT METHODS
@ -2040,7 +2046,8 @@ declare module "@vue/runtime-core" {
did: string, did: string,
changes: Partial<Settings>, changes: Partial<Settings>,
): Promise<boolean>; ): Promise<boolean>;
$saveMySettings(changes: Partial<Settings>): Promise<boolean>; // @deprecated; see implementation note above
// $saveMySettings(changes: Partial<Settings>): Promise<boolean>;
// Cache management methods // Cache management methods
$refreshSettings(): Promise<Settings>; $refreshSettings(): Promise<Settings>;

4
src/views/HomeView.vue

@ -645,7 +645,9 @@ export default class HomeView extends Vue {
if (resp.status === 200) { if (resp.status === 200) {
// Ultra-concise settings update with automatic cache invalidation! // Ultra-concise settings update with automatic cache invalidation!
await this.$saveMySettings({ isRegistered: true }); await this.$saveUserSettings(this.activeDid, {
isRegistered: true,
});
this.isRegistered = true; this.isRegistered = true;
} }
} catch (error) { } catch (error) {

Loading…
Cancel
Save