     private var numberstodelete: Int?
     private var index: Int?
     var lastindex: Int?
+    var diddissappear: Bool = false
 
     @IBOutlet weak var snapshotstable: NSTableView!
     @IBOutlet weak var localCatalog: NSTextField!

import Foundation
import Cocoa

class ViewControllerSnapshots: NSViewController, SetDismisser, SetConfigurations, Delay, Attributedestring, GetIndex {

    private var hiddenID: Int?
    private var config: Configuration?


    override func viewDidAppear() {
        super.viewDidAppear()
        guard self.diddissappear == false else {
            globalMainQueue.async(execute: { () -> Void in
                self.snapshotstable.reloadData()
            })
            return
        }
        self.snapshotsloggdata = nil
        globalMainQueue.async(execute: { () -> Void in
            self.snapshotstable.reloadData()
        })
    }

    override func viewDidDisappear() {
        super.viewDidDisappear()
        self.lastindex = self.index
        self.diddissappear = true
    }

    private func deletesnapshotcatalogs() {
