forked from trent_larson/crowd-funder-for-time-pwa
fix: update Vue template syntax and improve Vite config
- Fix Vue template syntax in App.vue by using proper event handler format - Update Vite config to properly handle ESM imports and crypto modules - Add manual chunks for better code splitting - Improve environment variable handling in vite-env.d.ts - Fix TypeScript linting errors in App.vue
This commit is contained in:
@@ -35,49 +35,49 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Vue, Component, Prop } from "vue-facing-decorator";
|
||||
import { Vue, Component, Prop } from 'vue-facing-decorator'
|
||||
|
||||
import { NotificationIface } from "../constants/app";
|
||||
import { db, retrieveSettingsForActiveAccount } from "../db/index";
|
||||
import { MASTER_SETTINGS_KEY } from "../db/tables/settings";
|
||||
import { NotificationIface } from '../constants/app'
|
||||
import { db, retrieveSettingsForActiveAccount } from '../db/index'
|
||||
import { MASTER_SETTINGS_KEY } from '../db/tables/settings'
|
||||
|
||||
@Component
|
||||
export default class UserNameDialog extends Vue {
|
||||
$notify!: (notification: NotificationIface, timeout?: number) => void;
|
||||
$notify!: (notification: NotificationIface, timeout?: number) => void
|
||||
|
||||
@Prop({
|
||||
default:
|
||||
"This is not sent to servers. It is only shared with people when you send it to them.",
|
||||
'This is not sent to servers. It is only shared with people when you send it to them.'
|
||||
})
|
||||
sharingExplanation!: string;
|
||||
@Prop({ default: false }) callbackOnCancel!: boolean;
|
||||
sharingExplanation!: string
|
||||
@Prop({ default: false }) callbackOnCancel!: boolean
|
||||
|
||||
callback: (name?: string) => void = () => {};
|
||||
givenName = "";
|
||||
visible = false;
|
||||
callback: (name?: string) => void = () => {}
|
||||
givenName = ''
|
||||
visible = false
|
||||
|
||||
/**
|
||||
* @param aCallback - callback function for name, which may be ""
|
||||
*/
|
||||
async open(aCallback?: (name?: string) => void) {
|
||||
this.callback = aCallback || this.callback;
|
||||
const settings = await retrieveSettingsForActiveAccount();
|
||||
this.givenName = settings.firstName || "";
|
||||
this.visible = true;
|
||||
this.callback = aCallback || this.callback
|
||||
const settings = await retrieveSettingsForActiveAccount()
|
||||
this.givenName = settings.firstName || ''
|
||||
this.visible = true
|
||||
}
|
||||
|
||||
async onClickSaveChanges() {
|
||||
await db.settings.update(MASTER_SETTINGS_KEY, {
|
||||
firstName: this.givenName,
|
||||
});
|
||||
this.visible = false;
|
||||
this.callback(this.givenName);
|
||||
firstName: this.givenName
|
||||
})
|
||||
this.visible = false
|
||||
this.callback(this.givenName)
|
||||
}
|
||||
|
||||
onClickCancel() {
|
||||
this.visible = false;
|
||||
this.visible = false
|
||||
if (this.callbackOnCancel) {
|
||||
this.callback();
|
||||
this.callback()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user