Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

serve local file for background image #166

Merged
merged 5 commits into from
Jul 4, 2024
Merged

serve local file for background image #166

merged 5 commits into from
Jul 4, 2024

Conversation

eagleoflqj
Copy link
Member

@eagleoflqj eagleoflqj commented Jul 2, 2024

Please update submodule on merge.

@eagleoflqj eagleoflqj marked this pull request as ready for review July 4, 2024 02:14
@eagleoflqj eagleoflqj requested a review from ksqsf July 4, 2024 02:14
Copy link
Member

@ksqsf ksqsf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@State private var openPanel = NSOpenPanel()

func selectImage() {
mkdirP(imageDir.localPath())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(This seems not satisfying, but acceptable anyway)

var fileName = file.lastPathComponent
if !imageDir.contains(file) {
if !copyFile(file, imageDir.appendingPathComponent(fileName)) {
return
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should add an error message here, at least in the log file

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copyFile already logs on fail.
What I want to improve in the future is to provide a convenient way to trigger an AlertToast from nested subview to window's major view. Currently the only place that does the similar thing is

ImportTableView().load(
onError: { msg in
importTableErrorMsg = msg
showImportTableError = true
},
finalize: {
refresh()
})
}
.toast(isPresenting: $showImportTableError) {
AlertToast(
displayMode: .hud,
type: .error(Color.red), title: importTableErrorMsg)
}
but I'm too weak Swift programmer to make it flexible 🌚

@eagleoflqj eagleoflqj merged commit 3b6bf03 into master Jul 4, 2024
4 checks passed
@eagleoflqj eagleoflqj deleted the protocol branch July 4, 2024 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants