2020-08-27 21:26:12 -07:00
|
|
|
//
|
|
|
|
// FeedsViewController.swift
|
|
|
|
// NewsBlur
|
|
|
|
//
|
|
|
|
// Created by David Sinclair on 2020-08-27.
|
|
|
|
// Copyright © 2020 NewsBlur. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import UIKit
|
|
|
|
|
|
|
|
///Sidebar listing all of the feeds.
|
|
|
|
class FeedsViewController: FeedsObjCViewController {
|
2021-01-16 19:36:16 -08:00
|
|
|
var loadWorkItem: DispatchWorkItem?
|
2020-08-27 21:26:12 -07:00
|
|
|
|
2021-01-16 19:36:16 -08:00
|
|
|
@objc func loadNotificationStory() {
|
|
|
|
loadWorkItem?.cancel()
|
|
|
|
|
|
|
|
let workItem = DispatchWorkItem { [weak self] in
|
|
|
|
guard let self = self else {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
self.backgroundLoadNotificationStory()
|
|
|
|
}
|
|
|
|
|
|
|
|
loadWorkItem = workItem
|
2021-03-26 15:47:09 -07:00
|
|
|
DispatchQueue.main.asyncAfter(deadline: .now() + (isOffline ? .seconds(1) : .milliseconds(100)), execute: workItem)
|
2021-01-16 19:36:16 -08:00
|
|
|
}
|
2020-08-27 21:26:12 -07:00
|
|
|
}
|