-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: detect team app lock change (WPB-4476) (#2183)
* feat: use case for observing team app lock config * chore: rename Applock data class * feat: detect team app lock change * fix: app lock feature dialog being displayed when timeout is changed from team admin * chore: detekt * chore: unit test * chore: consider value changed when it's not found locally and config is enabled * chore: cleanup * chore: make use case internal
- Loading branch information
Showing
18 changed files
with
560 additions
and
93 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
logic/src/commonMain/kotlin/com/wire/kalium/logic/configuration/AppLockTeamConfig.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Wire | ||
* Copyright (C) 2023 Wire Swiss GmbH | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see http://www.gnu.org/licenses/. | ||
*/ | ||
package com.wire.kalium.logic.configuration | ||
|
||
import kotlin.time.Duration | ||
|
||
data class AppLockTeamConfig( | ||
val isEnabled: Boolean, | ||
val timeout: Duration, | ||
val isStatusChanged: Boolean? | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...in/kotlin/com/wire/kalium/logic/feature/applock/MarkTeamAppLockStatusAsNotifiedUseCase.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Wire | ||
* Copyright (C) 2023 Wire Swiss GmbH | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see http://www.gnu.org/licenses/. | ||
*/ | ||
package com.wire.kalium.logic.feature.applock | ||
|
||
import com.wire.kalium.logic.configuration.UserConfigRepository | ||
|
||
/** | ||
* Mark the team app lock status as notified | ||
* need to be called after notifying the user about the change | ||
* e.g. after showing a dialog, or a toast etc. | ||
*/ | ||
interface MarkTeamAppLockStatusAsNotifiedUseCase { | ||
operator fun invoke() | ||
} | ||
|
||
class MarkTeamAppLockStatusAsNotifiedUseCaseImpl internal constructor( | ||
private val userConfigRepository: UserConfigRepository | ||
) : MarkTeamAppLockStatusAsNotifiedUseCase { | ||
override operator fun invoke() { | ||
userConfigRepository.setTeamAppLockAsNotified() | ||
} | ||
} |
Oops, something went wrong.