mirror of
https://github.com/gkd-kit/gkd.git
synced 2024-11-16 03:32:38 +08:00
fix: 快照 explicitNulls=true
This commit is contained in:
parent
83677ea6cf
commit
af113619fe
|
@ -32,7 +32,7 @@ data class NodeInfo(
|
|||
quickFind: Boolean?,
|
||||
): Boolean? {
|
||||
// 如果父节点是无法查找的, 则所有子节点都是无法查找的
|
||||
// 如果一个节点是可查找的, 则所有兄弟节点都是可查找的(如果满足条件)
|
||||
// 如果一个节点是可查找的, 则所有兄弟节点及其祖先节点都是可查找的(如果满足条件)
|
||||
return if (nodeInfo != null) {
|
||||
val viewId = nodeInfo.viewIdResourceName
|
||||
if (viewId != null && viewId.isNotEmpty()) { // id='' 不满足查找
|
||||
|
|
|
@ -112,7 +112,7 @@ object SnapshotExt {
|
|||
val stream = File(getScreenshotPath(snapshot.id)).outputStream()
|
||||
bitmap.compress(Bitmap.CompressFormat.PNG, 100, stream)
|
||||
stream.close()
|
||||
val text = Singleton.json.encodeToString(snapshot)
|
||||
val text = Singleton.keepNullJson.encodeToString(snapshot)
|
||||
File(getSnapshotPath(snapshot.id)).writeText(text)
|
||||
DbSet.snapshotDao.insert(snapshot.toSnapshot())
|
||||
}
|
||||
|
|
|
@ -20,6 +20,14 @@ object Singleton {
|
|||
}
|
||||
}
|
||||
|
||||
val keepNullJson by lazy {
|
||||
Json {
|
||||
isLenient = true
|
||||
ignoreUnknownKeys = true
|
||||
encodeDefaults = true
|
||||
}
|
||||
}
|
||||
|
||||
val client by lazy {
|
||||
HttpClient(OkHttp) {
|
||||
install(ContentNegotiation) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user