File tree Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import {connect} from 'react-redux'
16
16
import { bindActionCreators } from 'redux'
17
17
import CommonRowItem from './common/CommonRowItem'
18
18
import { getRefreshHandler } from '../utils/actionUtils'
19
+ import { clearCache } from "../dao/db" ;
19
20
20
21
/**
21
22
* 设置
@@ -138,6 +139,24 @@ class SettingPage extends Component {
138
139
} )
139
140
} ) ;
140
141
} } />
142
+ < CommonRowItem
143
+ showIconNext = { true }
144
+ topLine = { false }
145
+ bottomLine = { false }
146
+ itemIcon = { "broadcast" }
147
+ textStyle = { [ styles . centered , styles . normalText , {
148
+ textAlignVertical : 'center' ,
149
+ marginHorizontal : Constant . normalMarginEdge
150
+ } ] }
151
+ iconSize = { 20 }
152
+ viewStyle = { [ {
153
+ borderRadius : 4 , marginTop : Constant . normalMarginEdge ,
154
+ paddingLeft : Constant . normalMarginEdge
155
+ } , styles . shadowCard ] }
156
+ itemText = { I18n ( 'clearCache' ) }
157
+ onClickFun = { ( ) => {
158
+ clearCache ( )
159
+ } } />
141
160
< CommonRowItem
142
161
showIconNext = { false }
143
162
topLine = { false }
@@ -153,6 +172,8 @@ class SettingPage extends Component {
153
172
Actions . reset ( "LoginPage" ) ;
154
173
loginActions . loginOut ( ) ;
155
174
} } />
175
+
176
+
156
177
</ View >
157
178
)
158
179
}
Original file line number Diff line number Diff line change @@ -286,4 +286,10 @@ let realm = new Realm({
286
286
]
287
287
} ) ;
288
288
289
+ export const clearCache = ( ) => {
290
+ realm . write ( ( ) => {
291
+ realm . deleteAll ( )
292
+ } )
293
+ } ;
294
+
289
295
export default realm ;
Original file line number Diff line number Diff line change @@ -173,6 +173,7 @@ I18n.translations = {
173
173
zhLanguage : 'Chinese' ,
174
174
enLanguage : 'English' ,
175
175
gone410 : '410 Gone' ,
176
+ clearCache : 'clearCache' ,
176
177
} ,
177
178
'zh-CN' : {
178
179
appName : 'GSYGitHubApp' ,
@@ -335,6 +336,7 @@ I18n.translations = {
335
336
zhLanguage : '中文' ,
336
337
enLanguage : '英文' ,
337
338
gone410 : '410 Gone,不存在吧?' ,
339
+ clearCache : '清除缓存' ,
338
340
}
339
341
} ;
340
342
You can’t perform that action at this time.
0 commit comments