package main import ( "FanslySync/utils" "context" "embed" "log" "github.com/wailsapp/wails/v2" "github.com/wailsapp/wails/v2/pkg/logger" "github.com/wailsapp/wails/v2/pkg/options" "github.com/wailsapp/wails/v2/pkg/options/assetserver" "github.com/wailsapp/wails/v2/pkg/runtime" ) //go:embed all:frontend/dist var assets embed.FS func main() { // Create an instance of the app structure app := NewApp() // Create our custom file logger fileLogger, loggerCreateErr := utils.NewRuntimeFileLogger() if loggerCreateErr != nil { log.Fatal(loggerCreateErr) } // Create application with options err := wails.Run(&options.App{ Title: "FanslySync", Width: 1024, Height: 768, AssetServer: &assetserver.Options{ Assets: assets, }, DisableResize: true, Logger: fileLogger, LogLevel: logger.ERROR, LogLevelProduction: logger.INFO, BackgroundColour: &options.RGBA{R: 27, G: 38, B: 54, A: 1}, OnStartup: func(ctx context.Context) { app.startup(ctx, fileLogger) }, Bind: []interface{}{ app, }, }) if err != nil { // Build a message box with the error utils.ShowMessageBox(app.ctx, "FanslySync | Initialization Error", "Could not start application.\n\nError: "+err.Error(), utils.WithDialogType(runtime.ErrorDialog)) runtime.Quit(app.ctx) } }