Skip to content

Commit

Permalink
fix(ci): lint
Browse files Browse the repository at this point in the history
Signed-off-by: Godefroy Ponsinet <godefroy.ponsinet@outlook.com>
  • Loading branch information
90dy committed Feb 21, 2019
1 parent c05865e commit a52a7be
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion client/react-native/common/components/Library/Animation.js
Expand Up @@ -3,7 +3,7 @@ import LottieView from 'lottie-react-native'

export default () => (
<LottieView
source={require('./../static/animation/BertyAnimation.json')}
source={require('../../static/animation/BertyAnimation.json')}
autoPlay
loop={false}
onAnimationFinish={() => this.setState({ showAnim: false })}
Expand Down
Expand Up @@ -27,6 +27,7 @@ const ContactCardModal = ({ navigation }) => {
>
{state => {
switch (state.type) {
default:
case state.loading:
return <Loader />
case state.success:
Expand Down
30 changes: 15 additions & 15 deletions core/pkg/deviceinfo/application.go
Expand Up @@ -2,27 +2,27 @@ package deviceinfo

import "sync"

var application_state_subs []chan Application_State
var application_state_mutex sync.Mutex
var applicationStateSubs []chan Application_State
var appplicationStateMutex sync.Mutex

func (*Application_State) Subscribe() <-chan Application_State {
sub := make(chan Application_State)
application_state_mutex.Lock()
application_state_subs = append(application_state_subs, sub)
application_state_mutex.Unlock()
appplicationStateMutex.Lock()
applicationStateSubs = append(applicationStateSubs, sub)
appplicationStateMutex.Unlock()
return sub
}

func (*Application_State) Unsubscribe(sub <-chan Application_State) {
application_state_mutex.Lock()
for i := range application_state_subs {
if application_state_subs[i] == sub {
application_state_subs = append(application_state_subs[:i], application_state_subs[i+1:]...)
close(application_state_subs[i])
appplicationStateMutex.Lock()
for i := range applicationStateSubs {
if applicationStateSubs[i] == sub {
applicationStateSubs = append(applicationStateSubs[:i], applicationStateSubs[i+1:]...)
close(applicationStateSubs[i])
break
}
}
application_state_mutex.Unlock()
appplicationStateMutex.Unlock()
}

func (app *Application) SetState(state Application_State) {
Expand All @@ -34,11 +34,11 @@ func (app *Application) SetState(state Application_State) {
)

app.State = state
application_state_mutex.Lock()
for i := range application_state_subs {
application_state_subs[i] <- app.State
appplicationStateMutex.Lock()
for i := range applicationStateSubs {
applicationStateSubs[i] <- app.State
}
application_state_mutex.Unlock()
appplicationStateMutex.Unlock()
}

func (app *Application) SetRoute(route string) {
Expand Down

0 comments on commit a52a7be

Please sign in to comment.