Fixed file delete
This commit is contained in:
		
							parent
							
								
									450e1cf9ca
								
							
						
					
					
						commit
						694e30de9d
					
				
							
								
								
									
										15
									
								
								js/core.js
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								js/core.js
									
									
									
									
									
								
							| @ -556,6 +556,21 @@ define( | |||||||
| 			}); | 			}); | ||||||
| 			version = "v2"; | 			version = "v2"; | ||||||
| 		} | 		} | ||||||
|  | 		 | ||||||
|  | 		// Upgrade from v2 to v3
 | ||||||
|  | 		if(version == "v2") { | ||||||
|  | 			var fileIndexList = _.compact(localStorage["file.list"].split(";")); | ||||||
|  | 			_.each(fileIndexList, function(fileIndex) { | ||||||
|  | 				if(!_.has(localStorage, fileIndex + ".sync")) { | ||||||
|  | 					localStorage.removeItem(fileIndex + ".title"); | ||||||
|  | 					localStorage.removeItem(fileIndex + ".publish"); | ||||||
|  | 					localStorage.removeItem(fileIndex + ".content"); | ||||||
|  | 					localStorage["file.list"] = localStorage["file.list"].replace(";" | ||||||
|  | 						+ fileIndex + ";", ";"); | ||||||
|  | 				} | ||||||
|  | 			}); | ||||||
|  | 			version = "v3"; | ||||||
|  | 		} | ||||||
| 		localStorage["version"] = version; | 		localStorage["version"] = version; | ||||||
| 	} | 	} | ||||||
| 	// Setup the localStorage when starting
 | 	// Setup the localStorage when starting
 | ||||||
|  | |||||||
| @ -89,17 +89,17 @@ define(["jquery", "core", "synchronizer", "publisher", "underscore"], | |||||||
| 
 | 
 | ||||||
| 		// Remove synchronized locations
 | 		// Remove synchronized locations
 | ||||||
| 		var syncIndexList = _.compact(localStorage[fileIndex + ".sync"].split(";")); | 		var syncIndexList = _.compact(localStorage[fileIndex + ".sync"].split(";")); | ||||||
| 		localStorage.removeItem(fileIndex + ".sync"); |  | ||||||
| 		_.each(syncIndexList, function(syncIndex) { | 		_.each(syncIndexList, function(syncIndex) { | ||||||
| 			fileManager.removeSync(syncIndex); | 			fileManager.removeSync(syncIndex); | ||||||
| 		}); | 		}); | ||||||
|  | 		localStorage.removeItem(fileIndex + ".sync"); | ||||||
| 		 | 		 | ||||||
| 		// Remove publish locations
 | 		// Remove publish locations
 | ||||||
| 		var publishIndexList = _.compact(localStorage[fileIndex + ".publish"].split(";")); | 		var publishIndexList = _.compact(localStorage[fileIndex + ".publish"].split(";")); | ||||||
| 		localStorage.removeItem(fileIndex + ".publish"); |  | ||||||
| 		_.each(publishIndexList, function(publishIndex) { | 		_.each(publishIndexList, function(publishIndex) { | ||||||
| 			fileManager.removePublish(publishIndex); | 			fileManager.removePublish(publishIndex); | ||||||
| 		}); | 		}); | ||||||
|  | 		localStorage.removeItem(fileIndex + ".publish"); | ||||||
| 
 | 
 | ||||||
| 		localStorage["file.list"] = localStorage["file.list"].replace(";" | 		localStorage["file.list"] = localStorage["file.list"].replace(";" | ||||||
| 			+ fileIndex + ";", ";"); | 			+ fileIndex + ";", ";"); | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 benweet
						benweet