Skip to content
New issue

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

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

Already on GitHub? # to your account

Add refresh logic when OnPutFile is received #170

Merged
merged 2 commits into from
Jul 10, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
174 changes: 87 additions & 87 deletions build/bundle.js

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion src/js/Controllers/BCController.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import RpcFactory from './RpcFactory'
import store from '../store'
import { updateAppList, activateApp, deactivateApp, registerApplication, unregisterApplication, policyUpdate, updateColorScheme, setAppIsConnected, onSystemCapabilityUpdated } from '../actions'
import { updateAppList, activateApp, deactivateApp, registerApplication, unregisterApplication, policyUpdate, onPutFile, updateColorScheme, setAppIsConnected, onSystemCapabilityUpdated } from '../actions'
import sdlController from './SDLController'
import externalPolicies from './ExternalPoliciesController'
import {flags} from '../Flags'
Expand Down Expand Up @@ -47,6 +47,10 @@ class BCController {
case "OnSystemCapabilityUpdated":
store.dispatch(onSystemCapabilityUpdated(rpc.params.systemCapability))
return null
case "OnPutFile":
store.dispatch(onPutFile(rpc.params.appID, rpc.params.syncFileName, rpc.params.fileType, rpc.params.fileSize,
rpc.params.offset, rpc.params.length, rpc.params.isSystemFile, rpc.params.isPersistentFile))
return null
case "UpdateDeviceList":
return true
case "MixingAudioSupported":
Expand Down
1 change: 1 addition & 0 deletions src/js/Controllers/Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ export default class Controller {
this.subscribeToNotification("Buttons.OnButtonSubscription")
this.subscribeToNotification("BasicCommunication.OnAppRegistered")
this.subscribeToNotification("BasicCommunication.OnAppUnregistered")
this.subscribeToNotification("BasicCommunication.OnPutFile")
this.subscribeToNotification("Navigation.OnVideoDataStreaming")
this.subscribeToNotification("SDL.OnStatusUpdate")
this.subscribeToNotification("BasicCommunication.OnSystemCapabilityUpdated")
Expand Down
2 changes: 1 addition & 1 deletion src/js/Templates/Shared/Image.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export default class Image extends React.Component {
)
} else {
return (
<img className={this.props.class} src={this.props.image} onError={e => this.onError(e)} />
<img className={this.props.class} src={this.props.image + "?m=" + new Date().getTime()} onError={e => this.onError(e)} />
)
}

Expand Down
17 changes: 16 additions & 1 deletion src/js/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ export const Actions = {
UPDATE_COLOR_SCHEME: "UPDATE_COLOR_SCHEME",
SET_APP_IS_CONNECTED: "SET_APP_IS_CONNECTED",
ON_SYSTEM_CAPABILITY_UPDATED: "ON_SYSTEM_CAPABILITY_UPDATED",
ON_APP_SERVICE_DATA: "ON_APP_SERVICE_DATA"
ON_APP_SERVICE_DATA: "ON_APP_SERVICE_DATA",
ON_PUT_FILE: "ON_PUT_FILE"
}

export const updateAppList = (applications) => {
Expand Down Expand Up @@ -264,4 +265,18 @@ export const onAppServiceData = (service_data) => {
type: Actions.ON_APP_SERVICE_DATA,
serviceData: service_data
}
}

export const onPutFile = (appID, fileName, fileType, fileSize, offset, length, isSystemFile, isPersistentFile) => {
return {
type: Actions.ON_PUT_FILE,
appID: appID,
fileName: fileName,
fileType: fileType,
fileSize: fileSize,
offset: offset,
length: length,
isSystemFile: isSystemFile,
isPersistentFile: isPersistentFile
}
}
6 changes: 5 additions & 1 deletion src/js/reducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,10 @@ function ui(state = {}, action) {
var app = newState[action.appID] ? newState[action.appID] : newAppState()
app.isDisconnected = false
return newState
case Actions.ON_PUT_FILE:
var newState = { ...state }
var app = newState[action.appID] ? newState[action.appID] : newAppState()
return newState
default:
return state
}
Expand Down Expand Up @@ -512,4 +516,4 @@ export const hmi = combineReducers({
ui,
system,
systemCapability
})
})