Skip to content

Commit

Permalink
fix: electron files stopped working
Browse files Browse the repository at this point in the history
  • Loading branch information
blakebyrnes committed Oct 9, 2024
1 parent 40c45a8 commit e6b1c5b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/preload/DesktopPagePreload.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @ts-ignore
const { contextBridge, ipcRenderer } = require('electron');
const { contextBridge, ipcRenderer, webUtils } = require('electron');

contextBridge.exposeInMainWorld('appBridge', {
async send<T>(api: string, args: any = {}): Promise<T> {
Expand All @@ -19,6 +19,9 @@ contextBridge.exposeInMainWorld('appBridge', {
getPrivateApiHost(): string {
return ipcRenderer.sendSync('getPrivateApiHost');
},
getFilePath(file: File): string {
return webUtils.getPathForFile(file);
},
});

document.addEventListener('desktop:api', (e: any) => {
Expand Down
18 changes: 16 additions & 2 deletions src/ui/src/pages/desktop/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import Versions from './views/datastore-details/Versions.vue';
import Datastores from './views/Datastores.vue';
import GettingStartedChromeAlive from './views/getting-started/ChromeAlive.vue';
import GettingStartedClone from './views/getting-started/Clone.vue';
import GettingStartedCredit from './views/getting-started/Credit.vue';
import GettingStartedQueryPayment from './views/getting-started/QueryPayment.vue';
import GettingStartedDatastore from './views/getting-started/Datastore.vue';
import GettingStartedDeploy from './views/getting-started/Deploy.vue';
import GettingStartedHero from './views/getting-started/Hero.vue';
Expand All @@ -40,6 +40,7 @@ declare global {
appBridge: {
send(api: string, args: any): Promise<any>;
getPrivateApiHost(): string;
getFilePath(file: File): string;
};
load(url: string): void;
}
Expand All @@ -56,6 +57,19 @@ window.load = function load(host: string) {

const router = VueRouter.createRouter({
history: VueRouter.createWebHashHistory(),
scrollBehavior(to, from, savedPosition) {
// if (to.hash) {
// // Required because our <RouterView> is wrapped in a <Transition>
// // So elements are mounted after a delay
// return tryScrollToAnchor(to.hash, 1000, 100);
// }

if (savedPosition) {
return savedPosition;
} else {
return { top: 0 };
}
},
routes: [
{
path: '/getting-started',
Expand All @@ -67,7 +81,7 @@ window.load = function load(host: string) {
{ path: 'deploy', component: GettingStartedDeploy },
{ path: 'payment', component: GettingStartedPayment },
{ path: 'query', component: GettingStartedQuery },
{ path: 'credit', component: GettingStartedCredit },
{ path: 'queryPayment', component: GettingStartedQueryPayment },
{ path: 'datastore', component: GettingStartedDatastore },
{ path: 'clone', component: GettingStartedClone },
],
Expand Down
2 changes: 1 addition & 1 deletion src/ui/src/pages/desktop/views/accounts/Overview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@
<slot v-if="account.heldBalance > 0n">
<span class="mr-3 whitespace-nowrap text-right font-light">On Hold:</span>
<span class="text-fuchsia-700"> {{ toArgons(account.heldBalance) }}</span
>>
>
</slot>

<span class="col-span-2 h-1 border-t border-gray-300">&nbsp;</span>
Expand Down

0 comments on commit e6b1c5b

Please sign in to comment.