Skip to content
Merged
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
12 changes: 1 addition & 11 deletions Stepic/AuthInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//

import UIKit
import MagicalRecord

class AuthInfo: NSObject {
static var shared = AuthInfo()
Expand All @@ -21,15 +20,6 @@ class AuthInfo: NSObject {
if let id = userId {
if let users = User.fetchById(id) {
let c = users.count
// if c > 1 {
// print("users count > 1, deleting all")
// for user in users {
// user.MR_deleteEntity()
// }
// c = 0
// CoreDataHelper.instance.save()
// }

if c == 0 {
print("No user with such id found, downloading")
ApiDataDownloader.users.retrieve(ids: [id], existing: [], refreshMode: .update, success: {
Expand Down Expand Up @@ -86,7 +76,7 @@ class AuthInfo: NSObject {

AuthInfo.shared.user = nil

self.setTokenValue(newToken)
self.setTokenValue(nil)
}
})
} else {
Expand Down