mirror of
https://github.com/fork-maintainers/iceraven-browser
synced 2024-11-19 09:25:34 +00:00
[fenix] Fix ktlint MaxLineLength issues.
This commit is contained in:
parent
d4849ca93e
commit
98f0427ea2
@ -50,8 +50,8 @@ sealed class QuickActionSheetAction : BrowserFragmentAction() {
|
||||
/**
|
||||
* Reducers for [BrowserFragmentStore].
|
||||
*
|
||||
* A top level reducer that receives the current [BrowserFragmentState] and an [Action] and then delegates to the proper child
|
||||
*
|
||||
* A top level reducer that receives the current [BrowserFragmentState] and an [Action] and then
|
||||
* delegates to the proper child
|
||||
*/
|
||||
private fun browserStateReducer(
|
||||
state: BrowserFragmentState,
|
||||
|
@ -36,7 +36,10 @@ data class ExceptionsFragmentState(val items: List<ExceptionsItem>) : State
|
||||
/**
|
||||
* The ExceptionsState Reducer.
|
||||
*/
|
||||
private fun exceptionsStateReducer(state: ExceptionsFragmentState, action: ExceptionsFragmentAction): ExceptionsFragmentState {
|
||||
private fun exceptionsStateReducer(
|
||||
state: ExceptionsFragmentState,
|
||||
action: ExceptionsFragmentAction
|
||||
): ExceptionsFragmentState {
|
||||
return when (action) {
|
||||
is ExceptionsFragmentAction.Change -> state.copy(items = action.list)
|
||||
}
|
||||
|
@ -45,13 +45,20 @@ sealed class BookmarkFragmentAction : Action {
|
||||
* @param action the action to perform
|
||||
* @return the new bookmarks state
|
||||
*/
|
||||
private fun bookmarkFragmentStateReducer(state: BookmarkFragmentState, action: BookmarkFragmentAction): BookmarkFragmentState {
|
||||
private fun bookmarkFragmentStateReducer(
|
||||
state: BookmarkFragmentState,
|
||||
action: BookmarkFragmentAction
|
||||
): BookmarkFragmentState {
|
||||
return when (action) {
|
||||
is BookmarkFragmentAction.Change -> {
|
||||
val items = state.mode.selectedItems.filter { it in action.tree }
|
||||
state.copy(
|
||||
tree = action.tree,
|
||||
mode = if (items.isEmpty()) BookmarkFragmentState.Mode.Normal else BookmarkFragmentState.Mode.Selecting(items.toSet())
|
||||
mode = if (items.isEmpty()) {
|
||||
BookmarkFragmentState.Mode.Normal
|
||||
} else {
|
||||
BookmarkFragmentState.Mode.Selecting(items.toSet())
|
||||
}
|
||||
)
|
||||
}
|
||||
is BookmarkFragmentAction.Select ->
|
||||
@ -59,7 +66,11 @@ private fun bookmarkFragmentStateReducer(state: BookmarkFragmentState, action: B
|
||||
is BookmarkFragmentAction.Deselect -> {
|
||||
val items = state.mode.selectedItems - action.item
|
||||
state.copy(
|
||||
mode = if (items.isEmpty()) BookmarkFragmentState.Mode.Normal else BookmarkFragmentState.Mode.Selecting(items)
|
||||
mode = if (items.isEmpty()) {
|
||||
BookmarkFragmentState.Mode.Normal
|
||||
} else {
|
||||
BookmarkFragmentState.Mode.Selecting(items)
|
||||
}
|
||||
)
|
||||
}
|
||||
BookmarkFragmentAction.DeselectAll ->
|
||||
|
@ -52,14 +52,21 @@ data class HistoryFragmentState(val items: List<HistoryItem>, val mode: Mode) :
|
||||
/**
|
||||
* The HistoryState Reducer.
|
||||
*/
|
||||
private fun historyStateReducer(state: HistoryFragmentState, action: HistoryFragmentAction): HistoryFragmentState {
|
||||
private fun historyStateReducer(
|
||||
state: HistoryFragmentState,
|
||||
action: HistoryFragmentAction
|
||||
): HistoryFragmentState {
|
||||
return when (action) {
|
||||
is HistoryFragmentAction.AddItemForRemoval ->
|
||||
state.copy(mode = HistoryFragmentState.Mode.Editing(state.mode.selectedItems + action.item))
|
||||
is HistoryFragmentAction.RemoveItemForRemoval -> {
|
||||
val selected = state.mode.selectedItems - action.item
|
||||
state.copy(
|
||||
mode = if (selected.isEmpty()) HistoryFragmentState.Mode.Normal else HistoryFragmentState.Mode.Editing(selected)
|
||||
mode = if (selected.isEmpty()) {
|
||||
HistoryFragmentState.Mode.Normal
|
||||
} else {
|
||||
HistoryFragmentState.Mode.Editing(selected)
|
||||
}
|
||||
)
|
||||
}
|
||||
is HistoryFragmentAction.ExitEditMode -> state.copy(mode = HistoryFragmentState.Mode.Normal)
|
||||
|
@ -44,7 +44,10 @@ sealed class AccountSettingsFragmentAction : Action {
|
||||
/**
|
||||
* The SearchState Reducer.
|
||||
*/
|
||||
private fun accountStateReducer(state: AccountSettingsFragmentState, action: AccountSettingsFragmentAction): AccountSettingsFragmentState {
|
||||
private fun accountStateReducer(
|
||||
state: AccountSettingsFragmentState,
|
||||
action: AccountSettingsFragmentAction
|
||||
): AccountSettingsFragmentState {
|
||||
return when (action) {
|
||||
is AccountSettingsFragmentAction.SyncFailed -> state.copy(lastSyncedDate = LastSyncTime.Failed(action.time))
|
||||
is AccountSettingsFragmentAction.SyncEnded -> state.copy(lastSyncedDate = LastSyncTime.Success(action.time))
|
||||
|
Loading…
Reference in New Issue
Block a user