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

Smooth out block editor loading state #1045

Merged
merged 4 commits into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
{
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 @@
parentController: UIViewController,
state: BlockEditor.RelatedModel
) {
self.id = state.id
relatedHostingView.update(
parentController: parentController,
rootView: BacklinksView(
Expand All @@ -102,7 +99,7 @@
EntryStub(
did: Did("did:key:abc123")!,
address: Slashlink("@example/foo")!,
excerpt: Subtext(markup: "An [[autopoietic system]] is a network of processes that recursively depend on each other for their own generation and realization."),

Check warning on line 102 in xcode/Subconscious/Shared/UIKit/BlockEditor/Appendix/Related/RelatedCell.swift

View workflow job for this annotation

GitHub Actions / SwiftLint

Line Length Violation: Line should be 100 characters or less; currently it has 188 characters (line_length)
isTruncated: true,
modified: Date.now
),
Expand Down
Loading
Loading