Skip to content
This repository has been archived by the owner on Aug 11, 2024. It is now read-only.

Commit

Permalink
Smooth out block editor loading state (#1045)
Browse files Browse the repository at this point in the history
Fixes #1043
  • Loading branch information
gordonbrander authored Dec 21, 2023
1 parent 1f1d97b commit 43d24db
Show file tree
Hide file tree
Showing 6 changed files with 258 additions and 122 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ import Foundation

extension BlockEditor {
/// A collection of related notes
struct RelatedModel: Hashable, Identifiable {
var id = UUID()
struct RelatedModel: Hashable {
/// Is related loading?
var loadingState = LoadingState.loading
var related: [EntryStub] = []
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ extension BlockEditor {
{
static let identifier = "RelatedCell"

var id: UUID = UUID()

var send: (RelatedAction) -> Void = { _ in }

private var relatedHostingView = UIHostingView<BacklinksView>()
Expand Down Expand Up @@ -76,7 +74,6 @@ extension BlockEditor {
parentController: UIViewController,
state: BlockEditor.RelatedModel
) {
self.id = state.id
relatedHostingView.update(
parentController: parentController,
rootView: BacklinksView(
Expand Down
Loading

0 comments on commit 43d24db

Please sign in to comment.