forked from jsnbuchanan/crowd-funder-for-time-pwa
- Restore runMigrations functionality for database schema migrations - Remove indexedDBMigrationService.ts (was for IndexedDB to SQLite migration) - Recreate migrationService.ts and db-sql/migration.ts for schema management - Add proper TypeScript error handling with type guards in AccountViewView - Fix CreateAndSubmitClaimResult property access in QuickActionBvcBeginView - Remove LeafletMouseEvent from Vue components array (it's a type, not component) - Add null check for UserNameDialog callback to prevent undefined assignment - Implement extractErrorMessage helper function for consistent error handling - Update router to remove database-migration route The migration system now properly handles database schema evolution across app versions, while the IndexedDB to SQLite migration service has been removed as it was specific to that one-time migration.
60 lines
1.7 KiB
Vue
60 lines
1.7 KiB
Vue
<template>
|
|
<div class="absolute right-5 top-[max(0.75rem,env(safe-area-inset-top))]">
|
|
<span class="align-center text-red-500 mr-2">{{ message }}</span>
|
|
<span class="ml-2">
|
|
<router-link
|
|
:to="{ name: 'help' }"
|
|
class="text-xs uppercase bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-1 rounded-md ml-1"
|
|
>
|
|
Help
|
|
</router-link>
|
|
</span>
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import { Component, Vue, Prop } from "vue-facing-decorator";
|
|
|
|
import { AppString, NotificationIface } from "../constants/app";
|
|
import * as databaseUtil from "../db/databaseUtil";
|
|
import { retrieveSettingsForActiveAccount } from "../db/index";
|
|
|
|
@Component
|
|
export default class TopMessage extends Vue {
|
|
$notify!: (notification: NotificationIface, timeout?: number) => void;
|
|
|
|
@Prop selected = "";
|
|
|
|
message = "";
|
|
|
|
async mounted() {
|
|
try {
|
|
const settings = await databaseUtil.retrieveSettingsForActiveAccount();
|
|
if (
|
|
settings.warnIfTestServer &&
|
|
settings.apiServer !== AppString.PROD_ENDORSER_API_SERVER
|
|
) {
|
|
const didPrefix = settings.activeDid?.slice(11, 15);
|
|
this.message = "You're not using prod, user " + didPrefix;
|
|
} else if (
|
|
settings.warnIfProdServer &&
|
|
settings.apiServer === AppString.PROD_ENDORSER_API_SERVER
|
|
) {
|
|
const didPrefix = settings.activeDid?.slice(11, 15);
|
|
this.message = "You are using prod, user " + didPrefix;
|
|
}
|
|
} catch (err: unknown) {
|
|
this.$notify(
|
|
{
|
|
group: "alert",
|
|
type: "danger",
|
|
title: "Error Detecting Server",
|
|
text: JSON.stringify(err),
|
|
},
|
|
-1,
|
|
);
|
|
}
|
|
}
|
|
}
|
|
</script>
|