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

Add logic for CloseApplication RPC #171

Merged
merged 2 commits into from
Jul 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions build/bundle.js

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion src/js/Controllers/BCController.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,14 @@ class BCController {
store.dispatch(setAppIsConnected(rpc.params.appID))
store.dispatch(activateApp(rpc.params.appID))
return true
case "CloseApplication":
store.dispatch(deactivateApp(rpc.params.appID))
return true
case "OnAppRegistered":
store.dispatch(registerApplication(rpc.params.application.appID, rpc.params.application.isMediaApplication))
return null
case "OnAppUnregistered":
store.dispatch(deactivateApp())
store.dispatch(deactivateApp(rpc.params.appID))
store.dispatch(unregisterApplication(rpc.params.appID, rpc.params.unexpectedDisconnect))
return null
case "OnSystemCapabilityUpdated":
Expand Down
3 changes: 2 additions & 1 deletion src/js/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ export const activateApp = (appID) => {

export const deactivateApp = (appID) => {
return {
type: Actions.DEACTIVATE_APP
type: Actions.DEACTIVATE_APP,
appID: appID
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/js/reducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ function activeApp(state = null, action) {
case Actions.ACTIVATE_APP:
return action.activeApp
case Actions.DEACTIVATE_APP:
return null;
return action.appID == state ? null : state;
default:
return state
}
Expand Down