Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Commit

Permalink
Fixes for wails 2.0beta35
Browse files Browse the repository at this point in the history
  • Loading branch information
achhabra2 committed Apr 30, 2022
1 parent cca658b commit 60e2d15
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 96 deletions.
2 changes: 1 addition & 1 deletion frontend/dist/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion frontend/dist/bundle.js.map

Large diffs are not rendered by default.

46 changes: 27 additions & 19 deletions frontend/src/receiver.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
<script>
import {ReceiveFile, OpenFile, GetUserPrefs, CancelWormholeRequest, GetReceivedFile} from '../wailsjs/go/main/App'
import {
ReceiveFile,
OpenFile,
GetUserPrefs,
CancelWormholeRequest,
GetReceivedFile,
} from "../wailsjs/go/main/App";
import Progress from "./progress.svelte";
import {onMount} from "svelte";
import { onMount } from "svelte";
let receiveCode = "";
const receivePattern = /\d+\-\w+\-\w+/;
Expand Down Expand Up @@ -34,21 +39,18 @@
}
function openDownloadsFolder() {
GetUserPrefs().then(prefs => {
GetUserPrefs().then((prefs) => {
OpenFile(prefs.downloadsDirectory);
});
}
function onCancel() {
CancelWormholeRequest().then(() => {
isReceiving = false;
receiveCode = "";
status = "waiting";
receivePercent = 0;
receivePath = "";
}).catch(err => {
console.log(err);
});
CancelWormholeRequest();
isReceiving = false;
receiveCode = "";
status = "waiting";
receivePercent = 0;
receivePath = "";
}
window.runtime.EventsOn("receive:updated", function (percent) {
Expand All @@ -74,7 +76,7 @@
});
onMount(() => {
GetReceivedFile().then(path => {
GetReceivedFile().then((path) => {
if (path) {
receivePath = path;
}
Expand All @@ -94,10 +96,14 @@
<div class="icon-lg receive-file-icon" />
<span class="text-gray-200">{receiveFileName}</span>
{#if !isReceiving}
<div class="inline-flex space-x-1">
<button class="open-button text-sm" on:click={openFile}>Open File</button>
<button class="open-button text-sm" on:click={openDownloadsFolder}>Open Folder</button>
</div>
<div class="inline-flex space-x-1">
<button class="open-button text-sm" on:click={openFile}
>Open File</button
>
<button class="open-button text-sm" on:click={openDownloadsFolder}
>Open Folder</button
>
</div>
{/if}
</div>
{/if}
Expand All @@ -112,7 +118,9 @@
bind:value={receiveCode}
class="receive-input"
/>
<button class="receive-button" type="submit" disabled={!receiveCodeValid}>Download</button>
<button class="receive-button" type="submit" disabled={!receiveCodeValid}
>Download</button
>
</form>
</div>
{#if isReceiving}
Expand Down
13 changes: 4 additions & 9 deletions frontend/src/sender.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,10 @@
function onCancel() {
CancelWormholeRequest()
.then(() => {
isSending = false;
sendCode = "";
status = "waiting";
sendPercent = 0;
})
.catch((err) => {
console.log(err);
});
isSending = false;
sendCode = "";
status = "waiting";
sendPercent = 0;
}
function copyCode() {
Expand Down
44 changes: 22 additions & 22 deletions frontend/wailsjs/go/main/App.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,50 @@
// This file is automatically generated. DO NOT EDIT
import {settings} from '../models';

export function ReceiveFile(arg1:string):void;

export function SendFile(arg1:string):void;
export function GetCurrentVersion():Promise<string>;

export function GetReceivedFile():Promise<string>;
export function PersistUserSettings():void;

export function OpenDirectoryDialog():Promise<Array<string>|Error>;
export function UpdateCheckUI():void;

export function OpenFile(arg1:string):void;
export function CancelWormholeRequest():void;

export function GetLogPath():Promise<string>;

export function SetOverwriteParam(arg1:boolean):Promise<boolean>;

export function ShowErrorDialog(arg1:string):void;

export function UpdateCheckUI():void;
export function GetReceivedFile():Promise<string>;

export function UpdateSendProgress(arg1:number,arg2:number):void;

export function CancelWormholeRequest():void;

export function ClearSelectedFiles():void;
export function ReceiveFile(arg1:string):void;

export function GetCurrentVersion():Promise<string>;
export function SendDirectory(arg1:string):void;

export function SetSelfUpdateParam(arg1:boolean):Promise<boolean>;
export function SetNotificationsParam(arg1:boolean):Promise<boolean>;

export function AppInstalledFromPackageManager():Promise<boolean>;
export function ClearSelectedFiles():void;

export function GetSelectedFiles():Promise<Array<string>>;

export function PersistUserSettings():void;
export function OpenFile(arg1:string):void;

export function SendDirectory(arg1:string):void;
export function OpenFilesDialog():Promise<Array<string>|Error>;

export function SendFile(arg1:string):void;

export function SetDownloadsFolder():Promise<string>;

export function SetNotificationsParam(arg1:boolean):Promise<boolean>;
export function SetOverwriteParam(arg1:boolean):Promise<boolean>;

export function VerifyNotificationIcon():Promise<string>;
export function SetSelfUpdateParam(arg1:boolean):Promise<boolean>;

export function AppInstalledFromPackageManager():Promise<boolean>;

export function GetUserPrefs():Promise<settings.UserSettings>;

export function OpenFilesDialog():Promise<Array<string>|Error>;
export function OpenDirectoryDialog():Promise<Array<string>|Error>;

export function SelectedFilesSend():void;

export function ShowErrorDialog(arg1:string):void;

export function VerifyNotificationIcon():Promise<string>;
88 changes: 44 additions & 44 deletions frontend/wailsjs/go/main/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,98 +2,98 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT

export function ReceiveFile(arg1) {
window['go']['main']['App']['ReceiveFile'](arg1);
}

export function SendFile(arg1) {
window['go']['main']['App']['SendFile'](arg1);
export function GetCurrentVersion() {
return window['go']['main']['App']['GetCurrentVersion']();
}

export function GetReceivedFile() {
return window['go']['main']['App']['GetReceivedFile']();
export function PersistUserSettings() {
window['go']['main']['App']['PersistUserSettings']();
}

export function OpenDirectoryDialog() {
return window['go']['main']['App']['OpenDirectoryDialog']();
export function UpdateCheckUI() {
window['go']['main']['App']['UpdateCheckUI']();
}

export function OpenFile(arg1) {
window['go']['main']['App']['OpenFile'](arg1);
export function CancelWormholeRequest() {
window['go']['main']['App']['CancelWormholeRequest']();
}

export function GetLogPath() {
return window['go']['main']['App']['GetLogPath']();
}

export function SetOverwriteParam(arg1) {
return window['go']['main']['App']['SetOverwriteParam'](arg1);
}

export function ShowErrorDialog(arg1) {
window['go']['main']['App']['ShowErrorDialog'](arg1);
}

export function UpdateCheckUI() {
window['go']['main']['App']['UpdateCheckUI']();
export function GetReceivedFile() {
return window['go']['main']['App']['GetReceivedFile']();
}

export function UpdateSendProgress(arg1, arg2) {
window['go']['main']['App']['UpdateSendProgress'](arg1, arg2);
}

export function CancelWormholeRequest() {
window['go']['main']['App']['CancelWormholeRequest']();
}

export function ClearSelectedFiles() {
window['go']['main']['App']['ClearSelectedFiles']();
export function ReceiveFile(arg1) {
window['go']['main']['App']['ReceiveFile'](arg1);
}

export function GetCurrentVersion() {
return window['go']['main']['App']['GetCurrentVersion']();
export function SendDirectory(arg1) {
window['go']['main']['App']['SendDirectory'](arg1);
}

export function SetSelfUpdateParam(arg1) {
return window['go']['main']['App']['SetSelfUpdateParam'](arg1);
export function SetNotificationsParam(arg1) {
return window['go']['main']['App']['SetNotificationsParam'](arg1);
}

export function AppInstalledFromPackageManager() {
return window['go']['main']['App']['AppInstalledFromPackageManager']();
export function ClearSelectedFiles() {
window['go']['main']['App']['ClearSelectedFiles']();
}

export function GetSelectedFiles() {
return window['go']['main']['App']['GetSelectedFiles']();
}

export function PersistUserSettings() {
window['go']['main']['App']['PersistUserSettings']();
export function OpenFile(arg1) {
window['go']['main']['App']['OpenFile'](arg1);
}

export function SendDirectory(arg1) {
window['go']['main']['App']['SendDirectory'](arg1);
export function OpenFilesDialog() {
return window['go']['main']['App']['OpenFilesDialog']();
}

export function SendFile(arg1) {
window['go']['main']['App']['SendFile'](arg1);
}

export function SetDownloadsFolder() {
return window['go']['main']['App']['SetDownloadsFolder']();
}

export function SetNotificationsParam(arg1) {
return window['go']['main']['App']['SetNotificationsParam'](arg1);
export function SetOverwriteParam(arg1) {
return window['go']['main']['App']['SetOverwriteParam'](arg1);
}

export function VerifyNotificationIcon() {
return window['go']['main']['App']['VerifyNotificationIcon']();
export function SetSelfUpdateParam(arg1) {
return window['go']['main']['App']['SetSelfUpdateParam'](arg1);
}

export function AppInstalledFromPackageManager() {
return window['go']['main']['App']['AppInstalledFromPackageManager']();
}

export function GetUserPrefs() {
return window['go']['main']['App']['GetUserPrefs']();
}

export function OpenFilesDialog() {
return window['go']['main']['App']['OpenFilesDialog']();
export function OpenDirectoryDialog() {
return window['go']['main']['App']['OpenDirectoryDialog']();
}

export function SelectedFilesSend() {
window['go']['main']['App']['SelectedFilesSend']();
}

export function ShowErrorDialog(arg1) {
window['go']['main']['App']['ShowErrorDialog'](arg1);
}

export function VerifyNotificationIcon() {
return window['go']['main']['App']['VerifyNotificationIcon']();
}

0 comments on commit 60e2d15

Please sign in to comment.