Skip to content

Commit

Permalink
fix toggle nowplaying fail bug
Browse files Browse the repository at this point in the history
  • Loading branch information
listen1 committed Jul 10, 2020
1 parent 3a3bf51 commit d9c531b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ const main = () => {

if (url === '/now_playing') {
$scope.window_type = 'track';
$scope.window_url_stack.push({url:url, offset:offset});
$scope.window_poped_url_stack = [];
return;
}
$scope.window_url_stack.push({url:url, offset:offset});
Expand Down Expand Up @@ -301,7 +303,10 @@ const main = () => {
if ($scope.window_url_stack.length===0) {
return;
}
const poped = $scope.window_url_stack.pop();
let poped = $scope.window_url_stack.pop();
if ($scope.window_url_stack.length > 0 && $scope.window_url_stack[$scope.window_url_stack.length-1].url === '/now_playing'){
poped = $scope.window_url_stack.pop();
}
$scope.window_poped_url_stack.push(poped.url);
if ($scope.window_url_stack.length === 0) {
$scope.closeWindow(poped.offset);
Expand Down

0 comments on commit d9c531b

Please sign in to comment.