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

Commit

Permalink
Bugfixes, temporarily remove cancel
Browse files Browse the repository at this point in the history
  • Loading branch information
achhabra2 committed Dec 17, 2021
1 parent f8b71f5 commit 2cd90ed
Show file tree
Hide file tree
Showing 13 changed files with 48 additions and 28 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# README
# RiftShare

![GitHub all releases](https://img.shields.io/github/downloads/achhabra2/riftshare/total)
![GitHub](https://img.shields.io/github/license/achhabra2/riftshare)
![GitHub Release Date](https://img.shields.io/github/release-date/achhabra2/riftshare)
![GitHub release (latest by date)](https://img.shields.io/github/v/release/achhabra2/riftshare)
![GitHub Repo stars](https://img.shields.io/github/stars/achhabra2/riftshare?style=social)

## About

Expand Down
10 changes: 7 additions & 3 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ type App struct {
wormholeCancel *context.CancelFunc
LogPath string
UserPrefs settings.UserSettings
IsTransferring bool
}

// NewApp creates a new App application struct
Expand All @@ -49,6 +50,7 @@ func (b *App) startup(ctx context.Context) {
runtime.LogError(b.ctx, err.Error())
}
b.UserPrefs = setting
b.UserPrefs.Version = "v" + b.GetCurrentVersion()
b.c.Notifications = setting.Notifications
b.c.OverwriteExisting = setting.Overwrite
b.c.DownloadPath = setting.DownloadsDirectory
Expand Down Expand Up @@ -144,6 +146,7 @@ func (b *App) SendFile(filePath string) {
if filepath.Ext(filePath) == ".zip" {
os.Remove(filePath)
}
return
}
}()
}
Expand All @@ -161,7 +164,7 @@ func (b *App) SendDirectory(dirPath string) {
}
runtime.EventsEmit(b.ctx, "send:started", code)
runtime.EventsEmit(b.ctx, "send:status", "waiting for receiver")

s := <-status

if s.Error != nil {
Expand Down Expand Up @@ -348,7 +351,7 @@ func (b *App) UpdateCheckUI() {
}

func (b *App) GetDownloadsFolder() string {
return b.c.DownloadPath
return b.UserPrefs.DownloadsDirectory
}

func (b *App) GetCurrentVersion() string {
Expand All @@ -367,7 +370,8 @@ func (b *App) SetDownloadsFolder() string {
b.ShowErrorDialog(err.Error())
}
b.c.DownloadPath = selection
return b.c.DownloadPath
b.UserPrefs.DownloadsDirectory = selection
return b.UserPrefs.DownloadsDirectory
}

func (b *App) SetOverwriteParam(val bool) bool {
Expand Down
4 changes: 2 additions & 2 deletions build/darwin/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<key>CFBundleName</key><string>RiftShare</string>
<key>CFBundleExecutable</key><string>RiftShare</string>
<key>CFBundleIdentifier</key><string>app.riftshare</string>
<key>CFBundleVersion</key><string>0.1.0</string>
<key>CFBundleVersion</key><string>0.1.1</string>
<key>CFBundleGetInfoString</key><string>Riftshare - Easy, Secure, Free file sharing</string>
<key>CFBundleShortVersionString</key><string>0.1.0</string>
<key>CFBundleShortVersionString</key><string>0.1.1</string>
<key>CFBundleIconFile</key><string>iconfile.icns</string>
<key>LSMinimumSystemVersion</key><string>10.13.0</string>
<key>NSHighResolutionCapable</key><string>true</string>
Expand Down
2 changes: 1 addition & 1 deletion build/windows/RiftShare.exe.manifest
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<assemblyIdentity type="win32" name="app.riftshare" version="0.1.0.0" processorArchitecture="amd64"/>
<assemblyIdentity type="win32" name="app.riftshare" version="0.1.1.0" processorArchitecture="amd64"/>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/>
Expand Down
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.

8 changes: 6 additions & 2 deletions frontend/src/about.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@
<div class="container p4 text-gray-200">
<div>
Riftshare v{version}
<button class="text-blue-600" on:click={(event) => window.runtime.BrowserOpenURL("https://github.com/achhabra2/riftshare")}
>Github</button
<button class="text-blue-600" on:click={(event) => window.runtime.BrowserOpenURL("https://riftshare.app")}
>Website</button
>
<span> | </span>
<button class="text-blue-600" on:click={(event) => window.runtime.BrowserOpenURL("https://riftshare.app/faq.html")}
>FAQ</button
>
</div>

Expand Down
4 changes: 2 additions & 2 deletions frontend/src/receiver.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@
{#if isReceiving}
<Progress percent={receivePercent} {status}>
<div class="container grid">
<button class="my-2 mx-auto cancel-button" on:click={onCancel}
<!-- <button class="my-2 mx-auto cancel-button" on:click={onCancel}
>Cancel</button
>
> -->
</div>
</Progress>
{/if}
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/sender.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -177,19 +177,19 @@
{#if isSending}
<Progress percent={sendPercent} {status}>
<div class="container grid">
<button class="my-2 mx-auto cancel-button" on:click={onCancel}
<!-- <button class="my-2 mx-auto cancel-button" on:click={onCancel}
>Cancel</button
>
> -->
{#if sendCode}
<div class="mx-auto" transition:slide>
<div class="mx-auto mt-2" transition:slide>
<label for="sendCode" class="send-input-label">Send Code</label>
<input
id="sendCode"
readonly
type="text"
placeholder="Send code will appear"
value={sendCode}
class="send-input"
class="send-input mt-1"
/>
<button class="send-button" on:click={copyCode}>📄</button>
</div>
Expand Down
2 changes: 2 additions & 0 deletions frontend/wailsjs/go/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export class UserSettings {
overwrite: boolean;
downloadsDirectory: string;
selfUpdate: boolean;
version: string;

static createFrom(source: any = {}) {
return new UserSettings(source);
Expand All @@ -18,5 +19,6 @@ export class UserSettings {
this.overwrite = source["overwrite"];
this.downloadsDirectory = source["downloadsDirectory"];
this.selfUpdate = source["selfUpdate"];
this.version = source["version"];
}
}
17 changes: 14 additions & 3 deletions internal/settings/user_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"os"
"path/filepath"
"riftshare/internal/transport"
"riftshare/internal/update"
"runtime"

"gopkg.in/yaml.v2"
Expand All @@ -16,6 +17,13 @@ type UserSettings struct {
Overwrite bool `yaml:"overwrite" json:"overwrite"`
DownloadsDirectory string `yaml:"downloads_directory" json:"downloadsDirectory"`
SelfUpdate bool `yaml:"self_update" json:"selfUpdate"`
Version string `yaml:"version" json:"version"`
}

func getDefaultSettings() UserSettings {
ver := "v" + update.Version
settings := UserSettings{Notifications: false, Overwrite: true, DownloadsDirectory: transport.UserDownloadsFolder(), SelfUpdate: true, Version: ver}
return settings
}

func SaveUserSettings(settings UserSettings) error {
Expand All @@ -38,7 +46,7 @@ func GetUserSettings() (UserSettings, error) {
prefs, err := openPrefFile()
if err != nil {
log.Println(err)
return UserSettings{}, err
return getDefaultSettings(), err
}
defer prefs.Close()

Expand All @@ -47,13 +55,16 @@ func GetUserSettings() (UserSettings, error) {
err = decoder.Decode(&settings)
if err != nil {
log.Println(err)
return UserSettings{}, err
return getDefaultSettings(), err
}

if settings.Version == "" {
settings.SelfUpdate = true
}
// Check if file is empty
if settings == (UserSettings{}) {
// Initialize empty settings file
settings = UserSettings{Notifications: false, Overwrite: true, DownloadsDirectory: transport.UserDownloadsFolder(), SelfUpdate: true}
settings = getDefaultSettings()
}
return settings, nil
}
Expand Down
7 changes: 0 additions & 7 deletions internal/transport/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@ type Client struct {
DownloadPath string
}

// ShowNotification sends a notification if c.Notifications is true.
func (c *Client) ShowNotification(title, content string) {
if c.Notifications {
// TODO: Send Notification
}
}

// NewClient returns a new client for sending and receiving using wormhole-william
func NewClient() *Client {
return &Client{Notifications: false, OverwriteExisting: true, DownloadPath: UserDownloadsFolder()}
Expand Down
2 changes: 1 addition & 1 deletion internal/update/selfupdate.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/rhysd/go-github-selfupdate/selfupdate"
)

const Version = "0.1.0"
const Version = "0.1.1"

func DoSelfUpdate() bool {
v := semver.MustParse(Version)
Expand Down

0 comments on commit 2cd90ed

Please sign in to comment.