Skip to content

Commit

Permalink
Update Fula.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsan6sha authored Jan 23, 2024
1 parent 2b4aae2 commit b141ce1
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions ios/Fula.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1036,18 +1036,20 @@ class FulaModule: NSObject {

let recentLinksIterator = try fulaClient.listRecentCidsAsString()
var recentLinksList = [String]()
var hasNext = true

while hasNext {
do {
let nextLink = try recentLinksIterator.next(<#NSErrorPointer#>)
recentLinksList.append(nextLink)
} catch {
hasNext = false
while recentLinksIterator.hasNext() {
var error: NSError?
let nextLink = try recentLinksIterator.next(&error)

if let error = error {
throw error
}

recentLinksList.append(nextLink)
}

if !recentLinksList.isEmpty {
// Return the whole list
resolve(recentLinksList)
} else {
resolve(false)
Expand Down

0 comments on commit b141ce1

Please sign in to comment.