Browse Source

Fix initial load.

Nathaniel van Diepen 10 years ago
parent
commit
3d58159bd2
2 changed files with 5 additions and 18 deletions
  1. 4 0
      index.php
  2. 1 18
      js/index.js

+ 4 - 0
index.php

@@ -8,6 +8,10 @@
 			@rmdir('install');
 		}
 	}
+	if(!isset($_GET['type'])||!isset($_GET['id'])){
+		header('Location: page-index');
+		die();
+	}
 	require_once('php/include.php');
 	$salt = salt();
 	if(isset($_GET['get'])){

+ 1 - 18
js/index.js

@@ -281,30 +281,13 @@
 			$('#content').height($('body').height()-$('#topbar').height());
 			$('#content').getNiceScroll().resize();
 		});
-		if($.isEmptyObject(State.data)){
-			History.replaceState({
-				type: 'page',
-				id: 'index'
-			},'Bugs','page-index');
-			console.log('Forcing default state.');
-		}else{
-			flag('load',true);
-		}
 		var data = {
 			get: 'settings',
 			timestamp: +new Date
 		};
 		$.get(location.href,data,function(d){
 			settings = d;
-			apiState(location.href,function(){
-				if(flag('load')){
-					State.data = {
-						type: '',
-						data: ''
-					};
-				}
-				flag('load',false);
-			});
+			apiState(location.href);
 		},'json');
 	});
 	shortcut.add('f12',function(){