Remove unused code

Closes: #1105
This commit is contained in:
Bryan Montz
2023-05-07 14:13:06 -05:00
committed by William Casarin
parent 0da10eb716
commit 9847f12c95
105 changed files with 52 additions and 1873 deletions

View File

@@ -22,12 +22,8 @@ struct EventBody: View {
self.should_show_img = should_show_img ?? should_show_images(settings: damus_state.settings, contacts: damus_state.contacts, ev: event, our_pubkey: damus_state.pubkey)
}
var content: String {
event.get_content(damus_state.keypair.privkey)
}
var body: some View {
NoteContentView(damus_state: damus_state, event: event, show_images: should_show_img, size: size, artifacts: .just_content(content), options: options)
NoteContentView(damus_state: damus_state, event: event, show_images: should_show_img, size: size, options: options)
.frame(maxWidth: .infinity, alignment: .leading)
}
}

View File

@@ -14,8 +14,6 @@ struct EventMenuContext: View {
let bookmarks: BookmarksManager
let muted_threads: MutedThreadsManager
@Environment(\.colorScheme) var colorScheme
var body: some View {
HStack {
Menu {

View File

@@ -40,7 +40,7 @@ struct EventProfile: View {
}
}
EventProfileName(pubkey: pubkey, profile: profile, damus: damus_state, show_friend_confirmed: true, size: size)
EventProfileName(pubkey: pubkey, profile: profile, damus: damus_state, size: size)
}
}
}

View File

@@ -82,8 +82,6 @@ struct MutedEventView: View {
}
struct MutedEventView_Previews: PreviewProvider {
@State static var nav_target: NostrEvent = test_event
@State static var navigating: Bool = false
static var previews: some View {

View File

@@ -12,7 +12,6 @@ struct EventViewOptions: OptionSet {
static let no_action_bar = EventViewOptions(rawValue: 1 << 0)
static let no_replying_to = EventViewOptions(rawValue: 1 << 1)
static let no_images = EventViewOptions(rawValue: 1 << 2)
static let wide = EventViewOptions(rawValue: 1 << 3)
static let truncate_content = EventViewOptions(rawValue: 1 << 4)
static let pad_content = EventViewOptions(rawValue: 1 << 5)
@@ -133,18 +132,16 @@ struct TextEvent: View {
func ProfileName(is_anon: Bool) -> some View {
let profile = damus.profiles.lookup(id: pubkey)
let pk = is_anon ? "anon" : pubkey
return EventProfileName(pubkey: pk, profile: profile, damus: damus, show_friend_confirmed: true, size: .normal)
return EventProfileName(pubkey: pk, profile: profile, damus: damus, size: .normal)
}
func EvBody(options: EventViewOptions) -> some View {
let show_imgs = should_show_images(settings: damus.settings, contacts: damus.contacts, ev: event, our_pubkey: damus.pubkey)
let artifacts = damus.events.get_cache_data(event.id).artifacts.artifacts ?? .just_content(event.get_content(damus.keypair.privkey))
return NoteContentView(
damus_state: damus,
event: event,
show_images: show_imgs,
size: .normal,
artifacts: artifacts,
options: options
)
.fixedSize(horizontal: false, vertical: true)