From 0748021ffaa66ffb30b0a8ccbb0bfe17c3facb91 Mon Sep 17 00:00:00 2001 From: Kr328 <39107975+Kr328@users.noreply.github.com> Date: Wed, 15 Apr 2020 20:44:49 +0800 Subject: [PATCH] Fix cloned profile type --- build.gradle.kts | 4 ++-- .../java/com/github/kr328/clash/service/ProfileService.kt | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 867b414..179c26c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -10,8 +10,8 @@ buildscript { this["gMinSdkVersion"] = 24 this["gTargetSdkVersion"] = 29 - this["gVersionCode"] = 10204 - this["gVersionName"] = "1.2.4" + this["gVersionCode"] = 10205 + this["gVersionName"] = "1.2.5" this["gKotlinVersion"] = kotlinVersion this["gKotlinCoroutineVersion"] = "1.3.5" diff --git a/service/src/main/java/com/github/kr328/clash/service/ProfileService.kt b/service/src/main/java/com/github/kr328/clash/service/ProfileService.kt index 6092ef1..5435c4c 100644 --- a/service/src/main/java/com/github/kr328/clash/service/ProfileService.kt +++ b/service/src/main/java/com/github/kr328/clash/service/ProfileService.kt @@ -83,8 +83,12 @@ class ProfileService : BaseService() { val clonedId = generateNextId() pending[clonedId] = - queryMetadataById(id)?.copy(id = clonedId, active = false, lastModified = 0) - ?: return@runBlocking -1L + queryMetadataById(id)?.copy( + id = clonedId, + active = false, + lastModified = 0, + type = Profile.Type.FILE + ) ?: return@runBlocking -1L clonedId }