Refactor Electron's main process #951
No reviewers
Labels
No labels
accessibility
app-parity
area: creator
area: daemon
area: design
area: devops
area: discovery
area: docs
area: installer
area: internal
area: livestream
area: performance
area: proposal
area: reposts
area: rewards
area: search
area: security
area: subscriptions
area: sync
area: ux
area: viewer
area: wallet
BEAMER
channel
comments
community PR
consider soon
core team
css
dependencies
electron
Epic
feature request
first-timers-only
good first issue
hacktoberfest
help wanted
hub-dependent
icebox
Invalid
level: 0
level: 1
level: 2
level: 3
level: 4
merge when green
needs: exploration
needs: grooming
needs: priority
needs: repro
needs: tech design
notifications
odysee
on hold
playlists
priority: blocker
priority: high
priority: low
priority: medium
protocol dependent
recsys
redesign
regression
resilience
sdk dependent
Tom's Wishlist
trending
type: bug
type: discussion
type: improvement
type: new feature
type: refactor
type: task
type: testing
unplanned
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: LBRYCommunity/lbry-desktop#951
Loading…
Reference in a new issue
No description provided.
Delete branch "issue/938"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This closes #938, closes #298 and fixes #298.
@alexliebowitz I think a decent portion of this code was originally yours, it'd be good to get your eyes on this changeset.
I agree, everything looks good here to me but it would be gret to get Alex's take. I am ready to merge if Alex gives the thumbs up
Very minor things, can be merged now if needed. Awesome overall.
@ -0,0 +92,4 @@
}
});
window.webContents.on('crashed', () => {
It doesn't seem like this event is actually sent on the renderer side. Did you mean to build that, or is it something we're going to add later?
Hmm, now we're doing this same substitution in two places instead of in one function. That feels brittle (what if we find another problem with Windows URI handling and don't realize it's there in two places), and also
We might want to move this back into its own function, or at least add another comment here. Just a thought.
@ -0,0 +92,4 @@
}
});
window.webContents.on('crashed', () => {
It's necessary to handle it: https://electronjs.org/docs/api/web-contents#event-crashed
@ -0,0 +2,4 @@
import path from 'path';
import createWindow from './createWindow';
export default class Tray {
Does this need to be a whole object?
create()
is only called once and it doesn't need any state, so maybe just acreateTray
function that takes anupdateAttachedWindow
callback?@ -0,0 +2,4 @@
import path from 'path';
import createWindow from './createWindow';
export default class Tray {
I went for a exported
createTray()
function initially. However, since it also needs to manage the state of the window, I finally went for using a class.