function refreshTable() {
    deleteAllRowsExceptFirst();
    chrome.storage.sync.get(['blocklist'], function(result) {
        blocklist = result.blocklist;
        if (typeof blocklist !== 'undefined') {
            if (Object.keys(blocklist).length == 0) {
                $('h3').text('The block list is empty!');
                return;
            }
            $('h3').text('Block List');
            for (var id in blocklist) {
                user = blocklist[id];
                lastRow = $('div.mp-blocklist > table > tr:last');
                $('div.mp-blocklist table tr:last')
                    .after(`<tr>` +
                           `<td>${user.id}</td>` +
                           `<td>${user.screenName}</td>` +
                           `<td><button class="unblock" id="unblock-${user.id}">Unblock</button></td>` +
                           `</tr>`);
            }
            addButtonHandlers();
        } else {
           $('h3').text('There is no blocklist yet!');
        }
    });
}
/*
 * add current blocklist to table with unblock buttons
 */
add current blocklist to table with unblock buttons
add current blocklist to table with unblock buttons
function refreshTable() {
    deleteAllRowsExceptFirst();
    chrome.storage.sync.get(['blocklist'], function(result) {
        blocklist = result.blocklist;
        if (typeof blocklist !== 'undefined') {
            if (Object.keys(blocklist).length == 0) {
                $('h3').text('The block list is empty!');
                return;
            }
            $('h3').text('Block List');
            for (var id in blocklist) {
                user = blocklist[id];
                lastRow = $('div.mp-blocklist > table > tr:last');
                $('div.mp-blocklist table tr:last')
                    .after(`<tr>` +
                           `<td>${user.id}</td>` +
                           `<td>${user.screenName}</td>` +
                           `<td><button class="unblock" id="unblock-${user.id}">Unblock</button></td>` +
                           `</tr>`);
            }
            addButtonHandlers();
        } else {
           $('h3').text('There is no blocklist yet!');
        }
    });
}
function refreshTable ( ) { deleteAllRowsExceptFirst ( ) ; chrome . storage . sync . get ( [ 'blocklist' ] , function ( result ) { blocklist = result . blocklist ; if ( typeof blocklist !== 'undefined' ) { if ( Object . keys ( blocklist ) . length == 0 ) { $ ( 'h3' ) . text ( 'The block list is empty!' ) ; return ; } $ ( 'h3' ) . text ( 'Block List' ) ; for ( var id in blocklist ) { user = blocklist [ id ] ; lastRow = $ ( 'div.mp-blocklist > table > tr:last' ) ; $ ( 'div.mp-blocklist table tr:last' ) . after ( ` ` + ` ${ user . id } ` + ` ${ user . screenName } ` + ` ${ user . id } ` + ` ` ) ; } addButtonHandlers ( ) ; } else { $ ( 'h3' ) . text ( 'There is no blocklist yet!' ) ; } } ) ; }
add current blocklist to table with unblock buttons
add current blocklist to table with unblock buttons