Skip to content

Commit

Permalink
调整执行app版本迁移的判断代码,结果不变,只是优化代码
Browse files Browse the repository at this point in the history
  • Loading branch information
bandeapart committed Dec 31, 2024
1 parent 6f09d79 commit 3efa9f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/src/main/java/com/catpuppyapp/puppygit/utils/AppModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -537,8 +537,8 @@ object AppModel {

//不是最新版本,执行迁移, if ver==1 do sth, else if ==2, do sth else ... 最好用try...catch包裹,并且将迁移代码设置为幂等的,这样出错可再次重新调用

if(oldVer <= 47 && AppVersionMan.currentVersion >= 48) {
val success = AppMigrator.sinceVer47()
if(oldVer < 48 && AppVersionMan.currentVersion >= 48) {
val success = AppMigrator.sinceVer48()
if(!success) {
return@migrate false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ object AppMigrator {
*
* @return 本方法总是返回成功,即使操作失败 (只是本方法特殊而已,并非所有迁移方法都只返回成功,其他迁移方法有可能返回失败也有可能成功,需要看代码)
*/
suspend fun sinceVer47():Boolean {
val funName = "sinceVer47"
suspend fun sinceVer48():Boolean {
val funName = "sinceVer48"


// 更新FileOpenHistory内所有日期字段为UTC时间
Expand Down

0 comments on commit 3efa9f1

Please sign in to comment.