7 Commits

Author SHA1 Message Date
e3402dbfa3 update: app image 2025-02-01 19:24:31 +08:00
73687b889e feat: macOS about menu 2025-02-01 19:23:17 +08:00
4333d0ea2a fix: eof when save before load 2025-02-01 19:07:09 +08:00
e4f2d1aaab remove: debug print 2025-02-01 19:07:09 +08:00
bc67dab122 ignore: frontend files 2025-02-01 19:07:08 +08:00
ce5ca88694 ignore: frontend files 2025-02-01 19:07:08 +08:00
70ec35653d feat: change version 2025-02-01 19:07:08 +08:00
5 changed files with 18 additions and 9 deletions

2
.gitignore vendored
View File

@@ -2,6 +2,6 @@ build/bin
node_modules node_modules
frontend/dist frontend/dist
frontend/wailsjs frontend/wailsjs/
frontend/package.json.md5 frontend/package.json.md5

View File

@@ -74,6 +74,8 @@ const useStyles = makeStyles({
}, },
}) })
let loaded = false
export const App = () => { export const App = () => {
const styles = useStyles() const styles = useStyles()
@@ -199,17 +201,19 @@ export const App = () => {
}) })
}) })
Load().then(res => { Load().then(res => {
console.log(res)
setSaveTo(res.save_to as SaveTo) setSaveTo(res.save_to as SaveTo)
setSavePath(res.path) setSavePath(res.path)
loaded = true
}) })
}, []) }, [])
useEffect(() => { useEffect(() => {
if (loaded) {
Save({ Save({
save_to: saveTo, save_to: saveTo,
path: savePath, path: savePath,
}).then(_ => {}) }).then(_ => {})
}
}, [saveTo, savePath]) }, [saveTo, savePath])
OnFileDrop((_x, _y, paths) => { OnFileDrop((_x, _y, paths) => {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 407 KiB

After

Width:  |  Height:  |  Size: 425 KiB

View File

@@ -6,6 +6,7 @@ import (
"github.com/wailsapp/wails/v2" "github.com/wailsapp/wails/v2"
"github.com/wailsapp/wails/v2/pkg/options" "github.com/wailsapp/wails/v2/pkg/options"
"github.com/wailsapp/wails/v2/pkg/options/assetserver" "github.com/wailsapp/wails/v2/pkg/options/assetserver"
"github.com/wailsapp/wails/v2/pkg/options/mac"
"git.taurusxin.com/taurusxin/ncmdump-gui/utils" "git.taurusxin.com/taurusxin/ncmdump-gui/utils"
) )
@@ -40,6 +41,12 @@ func main() {
EnableFileDrop: true, EnableFileDrop: true,
DisableWebViewDrop: true, DisableWebViewDrop: true,
}, },
Mac: &mac.Options{
About: &mac.AboutInfo{
Title: "ncmdump-gui",
Message: "Copyright © 2025 TaurusXin",
},
},
}) })
if err != nil { if err != nil {

View File

@@ -2,7 +2,6 @@ package utils
import ( import (
"encoding/json" "encoding/json"
"fmt"
"os" "os"
"path/filepath" "path/filepath"
) )
@@ -75,7 +74,6 @@ func (cm *ConfigManager) Load() *Preference {
var preference *Preference = nil var preference *Preference = nil
decoder := json.NewDecoder(file) decoder := json.NewDecoder(file)
err = decoder.Decode(&preference) err = decoder.Decode(&preference)
fmt.Println(preference)
if err != nil { if err != nil {
return nil return nil
} }