Skip to content

Commit eb93a40

Browse files
authored
Merge pull request #260 from hypermodules/state-transfer-bugs
Fixing state transfer bugs
2 parents 7bfc482 + 864118b commit eb93a40

File tree

6 files changed

+17
-5
lines changed

6 files changed

+17
-5
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# hyperamp Change Log
2+
All notable changes to this project will be documented in this file.
3+
This project adheres to [Semantic Versioning](http://semver.org/).
4+
5+
## 0.5.3 - 2017-11-09
6+
* Added this here changelog
7+
* Fix some state transfer bugs
8+
9+
## 0.5.2 - 2017-11-10
10+
* Engage

main/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ app.on('window-all-closed', function allWindowsClosed () {
255255

256256
app.on('activate', function activate () {
257257
if (player.win === null) {
258+
al.recall()
258259
player.init()
259260
}
260261
globalShortcuts.reregister()

renderer/elements/player/progress.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,10 @@ class Progress extends Component {
110110

111111
update (state, emit) {
112112
this.emit = emit
113+
if (this.disabled !== truthy(state.player.currentIndex)) return true
113114
if (this.key !== get(state, 'player.currentTrack.key')) return true
114115
if (this.position !== state.player.currentTime) return true
115-
if (this.disabled !== truthy(state.player.currentIndex)) return true
116+
if (this.duration !== get(state, 'player.currentTrack.duration')) return true
116117
return false
117118
}
118119
}

renderer/elements/playlist/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class Playlist extends Component {
3131

3232
update (state, emit) {
3333
if (this.loading !== state.library.loading) return true
34-
if (this.trackView.update(state, emit)) return true
34+
this.trackView.render(state, emit)
3535
return false
3636
}
3737
}

renderer/elements/playlist/track-view.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ class TrackView extends Component {
262262
if (this.isNewQuery !== state.library.isNewQuery) return true
263263
if (shouldColumnsUpdate(this.columns, state.library.columns)) return true
264264
// Mutate
265-
if (this.currentIndex !== state.library.currentIndex) {
265+
if (this.currentIndex !== state.library.currentIndex && !this.isNewQuery) {
266266
this.mutateCurrentIndex(state.library.currentIndex)
267267
}
268268
if (this.selectedIndex !== state.library.selectedIndex) {

renderer/stores/library.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ function getInitialState () {
1616
currentIndex: mainState.al.index,
1717
search: mainState.al.searchTerm,
1818
selectedIndex: null,
19-
isNewQuery: false,
20-
loading: false,
19+
isNewQuery: mainState.al.isNewQuery,
20+
loading: mainState.loading,
2121
columns: Array.from(COLUMNS).reduce((obj, col) => {
2222
obj[col] = true
2323
return obj

0 commit comments

Comments
 (0)